Make tests pass in 2020
Without this patch, build failed after 2019-12-31 with Traceback (most recent call last): File "keystoneclient/tests/unit/v3/test_auth.py", line 226, in test_authenticate_success_password_unscoped self.assertRequestBodyIs(json=self.TEST_REQUEST_BODY) File "keystoneclient/tests/unit/utils.py", line 72, in assertRequestBodyIs self.assertEqual(json, val) Change-Id: I0e44d9896c5970f0ca07438c372aec826aeb5c77
This commit is contained in:
@@ -84,7 +84,7 @@ class V2IdentityPlugin(utils.TestCase):
|
|||||||
self.TEST_RESPONSE_DICT = {
|
self.TEST_RESPONSE_DICT = {
|
||||||
"access": {
|
"access": {
|
||||||
"token": {
|
"token": {
|
||||||
"expires": "2020-01-01T00:00:10.000123Z",
|
"expires": "2999-01-01T00:00:10.000123Z",
|
||||||
"id": self.TEST_TOKEN,
|
"id": self.TEST_TOKEN,
|
||||||
"tenant": {
|
"tenant": {
|
||||||
"id": self.TEST_TENANT_ID
|
"id": self.TEST_TENANT_ID
|
||||||
|
@@ -129,7 +129,7 @@ class V3IdentityPlugin(utils.TestCase):
|
|||||||
"password"
|
"password"
|
||||||
],
|
],
|
||||||
|
|
||||||
"expires_at": "2020-01-01T00:00:10.000123Z",
|
"expires_at": "2999-01-01T00:00:10.000123Z",
|
||||||
"project": {
|
"project": {
|
||||||
"domain": {
|
"domain": {
|
||||||
"id": self.TEST_DOMAIN_ID,
|
"id": self.TEST_DOMAIN_ID,
|
||||||
|
@@ -399,7 +399,7 @@ class Examples(fixtures.Fixture):
|
|||||||
'access': {
|
'access': {
|
||||||
'token': {
|
'token': {
|
||||||
'id': self.UUID_TOKEN_DEFAULT,
|
'id': self.UUID_TOKEN_DEFAULT,
|
||||||
'expires': '2020-01-01T00:00:10.000123Z',
|
'expires': '2999-01-01T00:00:10.000123Z',
|
||||||
'tenant': {
|
'tenant': {
|
||||||
'id': 'tenant_id1',
|
'id': 'tenant_id1',
|
||||||
'name': 'tenant_name1',
|
'name': 'tenant_name1',
|
||||||
@@ -420,7 +420,7 @@ class Examples(fixtures.Fixture):
|
|||||||
'access': {
|
'access': {
|
||||||
'token': {
|
'token': {
|
||||||
'id': self.VALID_DIABLO_TOKEN,
|
'id': self.VALID_DIABLO_TOKEN,
|
||||||
'expires': '2020-01-01T00:00:10.000123Z',
|
'expires': '2999-01-01T00:00:10.000123Z',
|
||||||
'tenantId': 'tenant_id1',
|
'tenantId': 'tenant_id1',
|
||||||
},
|
},
|
||||||
'user': {
|
'user': {
|
||||||
@@ -437,7 +437,7 @@ class Examples(fixtures.Fixture):
|
|||||||
'access': {
|
'access': {
|
||||||
'token': {
|
'token': {
|
||||||
'id': self.UUID_TOKEN_UNSCOPED,
|
'id': self.UUID_TOKEN_UNSCOPED,
|
||||||
'expires': '2020-01-01T00:00:10.000123Z',
|
'expires': '2999-01-01T00:00:10.000123Z',
|
||||||
},
|
},
|
||||||
'user': {
|
'user': {
|
||||||
'id': 'user_id1',
|
'id': 'user_id1',
|
||||||
@@ -453,7 +453,7 @@ class Examples(fixtures.Fixture):
|
|||||||
'access': {
|
'access': {
|
||||||
'token': {
|
'token': {
|
||||||
'id': 'valid-token',
|
'id': 'valid-token',
|
||||||
'expires': '2020-01-01T00:00:10.000123Z',
|
'expires': '2999-01-01T00:00:10.000123Z',
|
||||||
'tenant': {
|
'tenant': {
|
||||||
'id': 'tenant_id1',
|
'id': 'tenant_id1',
|
||||||
'name': 'tenant_name1',
|
'name': 'tenant_name1',
|
||||||
@@ -474,7 +474,7 @@ class Examples(fixtures.Fixture):
|
|||||||
'token': {
|
'token': {
|
||||||
'bind': {'kerberos': self.KERBEROS_BIND},
|
'bind': {'kerberos': self.KERBEROS_BIND},
|
||||||
'id': self.UUID_TOKEN_BIND,
|
'id': self.UUID_TOKEN_BIND,
|
||||||
'expires': '2020-01-01T00:00:10.000123Z',
|
'expires': '2999-01-01T00:00:10.000123Z',
|
||||||
'tenant': {
|
'tenant': {
|
||||||
'id': 'tenant_id1',
|
'id': 'tenant_id1',
|
||||||
'name': 'tenant_name1',
|
'name': 'tenant_name1',
|
||||||
@@ -496,7 +496,7 @@ class Examples(fixtures.Fixture):
|
|||||||
'token': {
|
'token': {
|
||||||
'bind': {'FOO': 'BAR'},
|
'bind': {'FOO': 'BAR'},
|
||||||
'id': self.UUID_TOKEN_UNKNOWN_BIND,
|
'id': self.UUID_TOKEN_UNKNOWN_BIND,
|
||||||
'expires': '2020-01-01T00:00:10.000123Z',
|
'expires': '2999-01-01T00:00:10.000123Z',
|
||||||
'tenant': {
|
'tenant': {
|
||||||
'id': 'tenant_id1',
|
'id': 'tenant_id1',
|
||||||
'name': 'tenant_name1',
|
'name': 'tenant_name1',
|
||||||
@@ -515,7 +515,7 @@ class Examples(fixtures.Fixture):
|
|||||||
},
|
},
|
||||||
self.v3_UUID_TOKEN_DEFAULT: {
|
self.v3_UUID_TOKEN_DEFAULT: {
|
||||||
'token': {
|
'token': {
|
||||||
'expires_at': '2020-01-01T00:00:10.000123Z',
|
'expires_at': '2999-01-01T00:00:10.000123Z',
|
||||||
'methods': ['password'],
|
'methods': ['password'],
|
||||||
'user': {
|
'user': {
|
||||||
'id': 'user_id1',
|
'id': 'user_id1',
|
||||||
@@ -542,7 +542,7 @@ class Examples(fixtures.Fixture):
|
|||||||
},
|
},
|
||||||
self.v3_UUID_TOKEN_UNSCOPED: {
|
self.v3_UUID_TOKEN_UNSCOPED: {
|
||||||
'token': {
|
'token': {
|
||||||
'expires_at': '2020-01-01T00:00:10.000123Z',
|
'expires_at': '2999-01-01T00:00:10.000123Z',
|
||||||
'methods': ['password'],
|
'methods': ['password'],
|
||||||
'user': {
|
'user': {
|
||||||
'id': 'user_id1',
|
'id': 'user_id1',
|
||||||
@@ -556,7 +556,7 @@ class Examples(fixtures.Fixture):
|
|||||||
},
|
},
|
||||||
self.v3_UUID_TOKEN_DOMAIN_SCOPED: {
|
self.v3_UUID_TOKEN_DOMAIN_SCOPED: {
|
||||||
'token': {
|
'token': {
|
||||||
'expires_at': '2020-01-01T00:00:10.000123Z',
|
'expires_at': '2999-01-01T00:00:10.000123Z',
|
||||||
'methods': ['password'],
|
'methods': ['password'],
|
||||||
'user': {
|
'user': {
|
||||||
'id': 'user_id1',
|
'id': 'user_id1',
|
||||||
@@ -581,7 +581,7 @@ class Examples(fixtures.Fixture):
|
|||||||
'access': {
|
'access': {
|
||||||
'token': {
|
'token': {
|
||||||
'id': self.SIGNED_TOKEN_SCOPED_KEY,
|
'id': self.SIGNED_TOKEN_SCOPED_KEY,
|
||||||
'expires': '2020-01-01T00:00:10.000123Z',
|
'expires': '2999-01-01T00:00:10.000123Z',
|
||||||
},
|
},
|
||||||
'user': {
|
'user': {
|
||||||
'id': 'user_id1',
|
'id': 'user_id1',
|
||||||
@@ -599,7 +599,7 @@ class Examples(fixtures.Fixture):
|
|||||||
'access': {
|
'access': {
|
||||||
'token': {
|
'token': {
|
||||||
'id': self.SIGNED_TOKEN_UNSCOPED_KEY,
|
'id': self.SIGNED_TOKEN_UNSCOPED_KEY,
|
||||||
'expires': '2020-01-01T00:00:10.000123Z',
|
'expires': '2999-01-01T00:00:10.000123Z',
|
||||||
},
|
},
|
||||||
'user': {
|
'user': {
|
||||||
'id': 'user_id1',
|
'id': 'user_id1',
|
||||||
@@ -613,7 +613,7 @@ class Examples(fixtures.Fixture):
|
|||||||
},
|
},
|
||||||
self.SIGNED_v3_TOKEN_SCOPED_KEY: {
|
self.SIGNED_v3_TOKEN_SCOPED_KEY: {
|
||||||
'token': {
|
'token': {
|
||||||
'expires_at': '2020-01-01T00:00:10.000123Z',
|
'expires_at': '2999-01-01T00:00:10.000123Z',
|
||||||
'methods': ['password'],
|
'methods': ['password'],
|
||||||
'user': {
|
'user': {
|
||||||
'id': 'user_id1',
|
'id': 'user_id1',
|
||||||
@@ -642,7 +642,7 @@ class Examples(fixtures.Fixture):
|
|||||||
'token': {
|
'token': {
|
||||||
'bind': {'kerberos': self.KERBEROS_BIND},
|
'bind': {'kerberos': self.KERBEROS_BIND},
|
||||||
'methods': ['password'],
|
'methods': ['password'],
|
||||||
'expires_at': '2020-01-01T00:00:10.000123Z',
|
'expires_at': '2999-01-01T00:00:10.000123Z',
|
||||||
'user': {
|
'user': {
|
||||||
'id': 'user_id1',
|
'id': 'user_id1',
|
||||||
'name': 'user_name1',
|
'name': 'user_name1',
|
||||||
@@ -669,7 +669,7 @@ class Examples(fixtures.Fixture):
|
|||||||
self.v3_UUID_TOKEN_UNKNOWN_BIND: {
|
self.v3_UUID_TOKEN_UNKNOWN_BIND: {
|
||||||
'token': {
|
'token': {
|
||||||
'bind': {'FOO': 'BAR'},
|
'bind': {'FOO': 'BAR'},
|
||||||
'expires_at': '2020-01-01T00:00:10.000123Z',
|
'expires_at': '2999-01-01T00:00:10.000123Z',
|
||||||
'methods': ['password'],
|
'methods': ['password'],
|
||||||
'user': {
|
'user': {
|
||||||
'id': 'user_id1',
|
'id': 'user_id1',
|
||||||
|
@@ -87,7 +87,7 @@ V2_VERSION.updated_str = UPDATED
|
|||||||
V2_AUTH_RESPONSE = jsonutils.dumps({
|
V2_AUTH_RESPONSE = jsonutils.dumps({
|
||||||
"access": {
|
"access": {
|
||||||
"token": {
|
"token": {
|
||||||
"expires": "2020-01-01T00:00:10.000123Z",
|
"expires": "2999-01-01T00:00:10.000123Z",
|
||||||
"id": 'fakeToken',
|
"id": 'fakeToken',
|
||||||
"tenant": {
|
"tenant": {
|
||||||
"id": '1'
|
"id": '1'
|
||||||
@@ -113,7 +113,7 @@ V3_AUTH_RESPONSE = jsonutils.dumps({
|
|||||||
"password"
|
"password"
|
||||||
],
|
],
|
||||||
|
|
||||||
"expires_at": "2020-01-01T00:00:10.000123Z",
|
"expires_at": "2999-01-01T00:00:10.000123Z",
|
||||||
"project": {
|
"project": {
|
||||||
"domain": {
|
"domain": {
|
||||||
"id": '1',
|
"id": '1',
|
||||||
|
@@ -28,7 +28,7 @@ class AuthenticateAgainstKeystoneTests(utils.TestCase):
|
|||||||
self.TEST_RESPONSE_DICT = {
|
self.TEST_RESPONSE_DICT = {
|
||||||
"access": {
|
"access": {
|
||||||
"token": {
|
"token": {
|
||||||
"expires": "2020-01-01T00:00:10.000123Z",
|
"expires": "2999-01-01T00:00:10.000123Z",
|
||||||
"id": self.TEST_TOKEN,
|
"id": self.TEST_TOKEN,
|
||||||
"tenant": {
|
"tenant": {
|
||||||
"id": self.TEST_TENANT_ID
|
"id": self.TEST_TENANT_ID
|
||||||
@@ -61,7 +61,7 @@ class AuthenticateAgainstKeystoneTests(utils.TestCase):
|
|||||||
|
|
||||||
# Build a new response
|
# Build a new response
|
||||||
TEST_TOKEN = "abcdef"
|
TEST_TOKEN = "abcdef"
|
||||||
resp_b['access']['token']['expires'] = '2020-01-01T00:00:10.000123Z'
|
resp_b['access']['token']['expires'] = '2999-01-01T00:00:10.000123Z'
|
||||||
resp_b['access']['token']['id'] = TEST_TOKEN
|
resp_b['access']['token']['id'] = TEST_TOKEN
|
||||||
|
|
||||||
# return expired first, and then the new response
|
# return expired first, and then the new response
|
||||||
|
@@ -28,7 +28,7 @@ class AuthenticateAgainstKeystoneTests(utils.TestCase):
|
|||||||
"password"
|
"password"
|
||||||
],
|
],
|
||||||
|
|
||||||
"expires_at": "2020-01-01T00:00:10.000123Z",
|
"expires_at": "2999-01-01T00:00:10.000123Z",
|
||||||
"project": {
|
"project": {
|
||||||
"domain": {
|
"domain": {
|
||||||
"id": self.TEST_DOMAIN_ID,
|
"id": self.TEST_DOMAIN_ID,
|
||||||
|
Reference in New Issue
Block a user