Force passing @keeper decorators permission checking on tests
hirokiky opened this issue · 0 comments
hirokiky commented
While testing, sometimes we want to avoid @keeper
decorator of views.
Like
self.client.force_login(user=user)
self.client.force_permission('view', obj)
It can reduce preparation to pass keepers' checking.
You can write tests for permissions on test_models or so separately.
class TestFoo(TestCase):
def test_has_view(self):
foo = FooFactory(...)
...
has_permission('view', foo, req)