def test_should_raise_if_an_action_is_registered_twice(self):
     # Setup
     actions_count_before = len(actions.get_actions())
     actions.register(SimpleAction)
     # Run & check
     with pytest.raises(ActionAlreadyRegistered):
         actions.register(SimpleAction)
     actions.unregister_all()
     actions_count_after = len(actions.get_actions())
     assert actions_count_before == actions_count_after
 def test_should_raise_if_an_action_is_registered_twice(self):
     # Setup
     actions_count_before = len(actions.get_actions())
     actions.register(SimpleAction)
     # Run & check
     with pytest.raises(ActionAlreadyRegistered):
         actions.register(SimpleAction)
     actions.unregister_all()
     actions_count_after = len(actions.get_actions())
     assert actions_count_before == actions_count_after
 def setup(self):
     yield
     actions.unregister_all()
 def setup(self):
     self.factory = RequestFactory()
     yield
     actions.unregister_all()
 def setup(self):
     yield
     actions.unregister_all()