Merge "Pass username on v3 token issue"
diff --git a/tempest/api/identity/v3/test_tokens.py b/tempest/api/identity/v3/test_tokens.py
index d5bed96..b410da6 100644
--- a/tempest/api/identity/v3/test_tokens.py
+++ b/tempest/api/identity/v3/test_tokens.py
@@ -34,6 +34,7 @@
# it to be 'default'
token_id, resp = self.non_admin_token.get_token(
user_id=user_id,
+ username=username,
user_domain_id=user_domain_id,
password=password,
auth_data=True)
@@ -49,9 +50,19 @@
self.assertGreater(expires_at, now)
subject_id = resp['user']['id']
- self.assertEqual(subject_id, user_id)
+ if user_id:
+ self.assertEqual(subject_id, user_id)
+ else:
+ # Expect a user ID, but don't know what it will be.
+ self.assertGreaterEqual(len(subject_id), 0,
+ 'Expected user ID in token.')
subject_name = resp['user']['name']
- self.assertEqual(subject_name, username)
+ if username:
+ self.assertEqual(subject_name, username)
+ else:
+ # Expect a user name, but don't know what it will be.
+ self.assertGreaterEqual(len(subject_name), 0,
+ 'Expected user name in token.')
self.assertEqual(resp['methods'][0], 'password')