django-keeper icon indicating copy to clipboard operation
django-keeper copied to clipboard

Force passing @keeper decorators permission checking on tests

Open hirokiky opened this issue 7 years ago • 0 comments

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)

hirokiky avatar Feb 06 '18 04:02 hirokiky