web/test/unittest_viewselector.py
branchtls-sprint
changeset 764 9de67b681624
parent 728 a95b284150d1
child 783 45d816326626
equal deleted inserted replaced
763:db18ecbed8f6 764:9de67b681624
   409     def test_owners_match_user_group(self):
   409     def test_owners_match_user_group(self):
   410         """tests usage of 'owners' group with match_user_group"""
   410         """tests usage of 'owners' group with match_user_group"""
   411         class SomeAction(Action):
   411         class SomeAction(Action):
   412             id = 'yo'
   412             id = 'yo'
   413             category = 'foo'
   413             category = 'foo'
   414             __select__ = match_user_groups('owners'),
   414             __select__ = match_user_groups('owners')
   415         self.vreg.register_vobject_class(SomeAction)
   415         self.vreg.register_vobject_class(SomeAction)
   416         self.failUnless(SomeAction in self.vreg['actions']['yo'], self.vreg['actions'])
   416         self.failUnless(SomeAction in self.vreg['actions']['yo'], self.vreg['actions'])
   417         try:
   417         try:
   418             # login as a simple user
   418             # login as a simple user
   419             self.create_user('john')
   419             self.create_user('john')
   434             del self.vreg[SomeAction.__registry__][SomeAction.id]
   434             del self.vreg[SomeAction.__registry__][SomeAction.id]
   435 
   435 
   436 
   436 
   437 from cubicweb.web.action import Action
   437 from cubicweb.web.action import Action
   438 
   438 
   439 class EETypeRQLAction(EntityAction):
   439 class EETypeRQLAction(Action):
   440     id = 'testaction'
   440     id = 'testaction'
   441     __select__ = implements('EEType') & rql_condition('X name "EEType"')
   441     __select__ = implements('EEType') & rql_condition('X name "EEType"')
   442     title = 'bla'
   442     title = 'bla'
   443 
   443 
   444 class RQLActionTC(ViewSelectorTC):
   444 class RQLActionTC(ViewSelectorTC):