server/test/unittest_migractions.py
branchstable
changeset 9565 fa00fc251d57
parent 9273 f3795da61959
child 9600 bde625698f44
equal deleted inserted replaced
9564:e2d5b0712974 9565:fa00fc251d57
   342             card = rschema.rdef('Personne', 'String').fulltextindexed
   342             card = rschema.rdef('Personne', 'String').fulltextindexed
   343             self.assertEqual(card, True)
   343             self.assertEqual(card, True)
   344         finally:
   344         finally:
   345             self.mh.cmd_change_relation_props('Personne', 'adel', 'String',
   345             self.mh.cmd_change_relation_props('Personne', 'adel', 'String',
   346                                               fulltextindexed=False)
   346                                               fulltextindexed=False)
       
   347 
       
   348     def test_sync_schema_props_perms_rqlconstraints(self):
       
   349         # Drop one of the RQLConstraint.
       
   350         rdef = self.schema['evaluee'].rdefs[('Personne', 'Note')]
       
   351         oldconstraints = rdef.constraints
       
   352         self.assertIn('S created_by U',
       
   353                       [cstr.expression for cstr in oldconstraints])
       
   354         self.mh.cmd_sync_schema_props_perms('evaluee', commit=True)
       
   355         newconstraints = rdef.constraints
       
   356         self.assertNotIn('S created_by U',
       
   357                          [cstr.expression for cstr in newconstraints])
       
   358 
       
   359         # Drop all RQLConstraint.
       
   360         rdef = self.schema['travaille'].rdefs[('Personne', 'Societe')]
       
   361         oldconstraints = rdef.constraints
       
   362         self.assertEqual(len(oldconstraints), 2)
       
   363         self.mh.cmd_sync_schema_props_perms('travaille', commit=True)
       
   364         rdef = self.schema['travaille'].rdefs[('Personne', 'Societe')]
       
   365         newconstraints = rdef.constraints
       
   366         self.assertEqual(len(newconstraints), 0)
   347 
   367 
   348     @tag('longrun')
   368     @tag('longrun')
   349     def test_sync_schema_props_perms(self):
   369     def test_sync_schema_props_perms(self):
   350         cursor = self.mh.session
   370         cursor = self.mh.session
   351         cursor.set_cnxset()
   371         cursor.set_cnxset()