diff options
| author | Jenkins <jenkins@review.openstack.org> | 2014-07-24 21:30:53 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2014-07-24 21:30:53 +0000 |
| commit | e58f7999f9011c7810b61483f8389713dfa7c72a (patch) | |
| tree | bb81caad0c57c96e7fe186eca9733e15af508895 /keystoneclient/tests/v2_0/test_users.py | |
| parent | 82e45a6f5cb3e63d60d369d9fe06cb29e0a699e3 (diff) | |
| parent | 0e9ecaa1547306f7af6527126fb88f8151908498 (diff) | |
| download | python-keystoneclient-0.10.1.tar.gz | |
Merge "Don't log sensitive auth data"0.10.1
Diffstat (limited to 'keystoneclient/tests/v2_0/test_users.py')
| -rw-r--r-- | keystoneclient/tests/v2_0/test_users.py | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/keystoneclient/tests/v2_0/test_users.py b/keystoneclient/tests/v2_0/test_users.py index 4246a51..89901e4 100644 --- a/keystoneclient/tests/v2_0/test_users.py +++ b/keystoneclient/tests/v2_0/test_users.py @@ -47,10 +47,11 @@ class UserTests(utils.TestCase): def test_create(self): tenant_id = uuid.uuid4().hex user_id = uuid.uuid4().hex + password = uuid.uuid4().hex req_body = { "user": { "name": "gabriel", - "password": "test", + "password": password, "tenantId": tenant_id, "email": "test@example.com", "enabled": True, @@ -63,7 +64,7 @@ class UserTests(utils.TestCase): "enabled": True, "tenantId": tenant_id, "id": user_id, - "password": "test", + "password": password, "email": "test@example.com", } } @@ -80,6 +81,7 @@ class UserTests(utils.TestCase): self.assertEqual(user.name, "gabriel") self.assertEqual(user.email, "test@example.com") self.assertRequestBodyIs(json=req_body) + self.assertNotIn(password, self.logger.output) @httpretty.activate def test_create_user_without_email(self): @@ -210,10 +212,11 @@ class UserTests(utils.TestCase): "name": "gabriel", } } + password = uuid.uuid4().hex req_2 = { "user": { "id": self.DEMO_USER_ID, - "password": "swordfish", + "password": password, } } tenant_id = uuid.uuid4().hex @@ -245,18 +248,22 @@ class UserTests(utils.TestCase): name='gabriel', email='gabriel@example.com') self.assertRequestBodyIs(json=req_1) - self.client.users.update_password(self.DEMO_USER_ID, 'swordfish') + self.client.users.update_password(self.DEMO_USER_ID, password) self.assertRequestBodyIs(json=req_2) self.client.users.update_tenant(self.DEMO_USER_ID, tenant_id) self.assertRequestBodyIs(json=req_3) self.client.users.update_enabled(self.DEMO_USER_ID, False) self.assertRequestBodyIs(json=req_4) + self.assertNotIn(password, self.logger.output) @httpretty.activate def test_update_own_password(self): + old_password = uuid.uuid4().hex + new_password = uuid.uuid4().hex req_body = { 'user': { - 'password': 'ABCD', 'original_password': 'DCBA' + 'password': new_password, + 'original_password': old_password } } resp_body = { @@ -267,8 +274,10 @@ class UserTests(utils.TestCase): json=resp_body) self.client.user_id = user_id - self.client.users.update_own_password('DCBA', 'ABCD') + self.client.users.update_own_password(old_password, new_password) self.assertRequestBodyIs(json=req_body) + self.assertNotIn(old_password, self.logger.output) + self.assertNotIn(new_password, self.logger.output) @httpretty.activate def test_user_role_listing(self): |
