server/test/unittest_session.py
changeset 9070 4a803380f718
parent 9020 cb87e831c183
child 9109 499db4fd03f8
equal deleted inserted replaced
9069:aff871b58ba0 9070:4a803380f718
    28 
    28 
    29 class SessionTC(CubicWebTC):
    29 class SessionTC(CubicWebTC):
    30 
    30 
    31     def test_hooks_control(self):
    31     def test_hooks_control(self):
    32         session = self.session
    32         session = self.session
       
    33         # this test check the "old" behavior of session with automatic connection management
       
    34         # close the default cnx, we do nto want it to interfer with the test
       
    35         self.cnx.close()
       
    36         # open a dedicated one
       
    37         session.set_cnx('Some-random-cnx-unrelated-to-the-default-one')
       
    38         # go test go
    33         self.assertEqual(HOOKS_ALLOW_ALL, session.hooks_mode)
    39         self.assertEqual(HOOKS_ALLOW_ALL, session.hooks_mode)
    34         self.assertEqual(set(), session.disabled_hook_categories)
    40         self.assertEqual(set(), session.disabled_hook_categories)
    35         self.assertEqual(set(), session.enabled_hook_categories)
    41         self.assertEqual(set(), session.enabled_hook_categories)
    36         self.assertEqual(1, len(session._cnxs))
    42         self.assertEqual(1, len(session._cnxs))
    37         with session.deny_all_hooks_but('metadata'):
    43         with session.deny_all_hooks_but('metadata'):