summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAdam Gandelman <adamg@canonical.com>2012-04-02 14:21:43 -0700
committerAdam Gandelman <adamg@canonical.com>2012-04-03 18:31:16 -0700
commit75a8dfef51f3566cd5d4cacee41f34bbbf9d15bd (patch)
tree0ec31a6741d683f5306e672f9b2f051ae78189a3 /tests
parent198fe22df9a924e08448b5220a694c4f9491b289 (diff)
downloadkeystone-75a8dfef51f3566cd5d4cacee41f34bbbf9d15bd.tar.gz
keystone-75a8dfef51f3566cd5d4cacee41f34bbbf9d15bd.tar.xz
keystone-75a8dfef51f3566cd5d4cacee41f34bbbf9d15bd.zip
Remove tenant membership during user deletion
Remove users' tenant membership on user deletion. Resolves a FK constraint issue that previously went unnoticed due to testing against database configurations that do not support FK constraints (MyISAM). Fixes LP bug 959294. Update: * Move tenant membership cleanup to the sql identity backend * Add a test case to test_backend_sql Change-Id: Ib4f5da03033f7886b36d1ab3b8b4ac37f08b2e0e
Diffstat (limited to 'tests')
-rw-r--r--tests/test_backend_sql.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/test_backend_sql.py b/tests/test_backend_sql.py
index 0770cf55..02626e6f 100644
--- a/tests/test_backend_sql.py
+++ b/tests/test_backend_sql.py
@@ -37,6 +37,17 @@ class SqlIdentity(test.TestCase, test_backend.IdentityTests):
self.identity_api = identity_sql.Identity()
self.load_fixtures(default_fixtures)
+ def test_delete_user_with_tenant_association(self):
+ user = {'id': 'fake',
+ 'name': 'fakeuser',
+ 'password': 'passwd'}
+ self.identity_api.create_user('fake', user)
+ self.identity_api.add_user_to_tenant(self.tenant_bar['id'],
+ user['id'])
+ self.identity_api.delete_user(user['id'])
+ tenants = self.identity_api.get_tenants_for_user(user['id'])
+ self.assertEquals(tenants, [])
+
class SqlToken(test.TestCase, test_backend.TokenTests):
def setUp(self):