hooks/test/unittest_hooks.py
changeset 4072 ead446e70c28
parent 4068 8f559c00e724
child 4089 ff92c7d692bf
equal deleted inserted replaced
4071:e19e586cc74e 4072:ead446e70c28
   432         self.session.set_pool()
   432         self.session.set_pool()
   433         dbhelper = self.session.pool.source('system').dbhelper
   433         dbhelper = self.session.pool.source('system').dbhelper
   434         sqlcursor = self.session.pool['system']
   434         sqlcursor = self.session.pool['system']
   435         try:
   435         try:
   436             self.execute('SET X indexed FALSE WHERE X relation_type R, R name "name"')
   436             self.execute('SET X indexed FALSE WHERE X relation_type R, R name "name"')
   437             self.failUnless(self.schema['name'].rproperty('Workflow', 'String', 'indexed'))
   437             self.failUnless(self.schema['name'].rdef('Workflow', 'String').indexed)
   438             self.failUnless(self.index_exists('Workflow', 'name'))
   438             self.failUnless(self.index_exists('Workflow', 'name'))
   439             self.commit()
   439             self.commit()
   440             self.failIf(self.schema['name'].rproperty('Workflow', 'String', 'indexed'))
   440             self.failIf(self.schema['name'].rdef('Workflow', 'String').indexed)
   441             self.failIf(self.index_exists('Workflow', 'name'))
   441             self.failIf(self.index_exists('Workflow', 'name'))
   442         finally:
   442         finally:
   443             self.execute('SET X indexed TRUE WHERE X relation_type R, R name "name"')
   443             self.execute('SET X indexed TRUE WHERE X relation_type R, R name "name"')
   444             self.failIf(self.schema['name'].rproperty('Workflow', 'String', 'indexed'))
   444             self.failIf(self.schema['name'].rproperty('Workflow', 'String').indexed)
   445             self.failIf(self.index_exists('Workflow', 'name'))
   445             self.failIf(self.index_exists('Workflow', 'name'))
   446             self.commit()
   446             self.commit()
   447             self.failUnless(self.schema['name'].rproperty('Workflow', 'String', 'indexed'))
   447             self.failUnless(self.schema['name'].rdef('Workflow', 'String').indexed)
   448             self.failUnless(self.index_exists('Workflow', 'name'))
   448             self.failUnless(self.index_exists('Workflow', 'name'))
   449 
   449 
   450     def test_unique_change(self):
   450     def test_unique_change(self):
   451         self.session.set_pool()
   451         self.session.set_pool()
   452         dbhelper = self.session.pool.source('system').dbhelper
   452         dbhelper = self.session.pool.source('system').dbhelper