perms are now held by the relation definition
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 09 Dec 2009 09:53:41 +0100
changeset 4068 8f559c00e724
parent 4067 c49fba955a9c
child 4069 5d149ba65dd0
perms are now held by the relation definition
hooks/test/unittest_hooks.py
--- a/hooks/test/unittest_hooks.py	Wed Dec 09 09:53:23 2009 +0100
+++ b/hooks/test/unittest_hooks.py	Wed Dec 09 09:53:41 2009 +0100
@@ -378,13 +378,13 @@
         self.assertEquals(schema['CWUser'].get_groups('read'), set(('managers', 'users',)))
 
     def test_perms_synchronization_2(self):
-        schema = self.repo.schema['in_group']
+        schema = self.repo.schema['in_group'].rdefs[('CWUser', 'CWGroup')]
         self.assertEquals(schema.get_groups('read'), set(('managers', 'users', 'guests')))
-        self.execute('DELETE X read_permission Y WHERE X is CWRType, X name "in_group", Y name "guests"')
+        self.execute('DELETE X read_permission Y WHERE X relation_type RT, RT name "in_group", Y name "guests"')
         self.assertEquals(schema.get_groups('read'), set(('managers', 'users', 'guests')))
         self.commit()
         self.assertEquals(schema.get_groups('read'), set(('managers', 'users')))
-        self.execute('SET X read_permission Y WHERE X is CWRType, X name "in_group", Y name "guests"')
+        self.execute('SET X read_permission Y WHERE X relation_type RT, RT name "in_group", Y name "guests"')
         self.assertEquals(schema.get_groups('read'), set(('managers', 'users')))
         self.commit()
         self.assertEquals(schema.get_groups('read'), set(('managers', 'users', 'guests')))