From bf3078f12e300b574f7810ce264c498fff19c430 Mon Sep 17 00:00:00 2001 From: Valder Gallo Date: Fri, 27 Jan 2017 09:40:27 -0200 Subject: [PATCH] add more tests without context --- graphene_django/tests/test_decorators.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/graphene_django/tests/test_decorators.py b/graphene_django/tests/test_decorators.py index b40cec3..0866305 100644 --- a/graphene_django/tests/test_decorators.py +++ b/graphene_django/tests/test_decorators.py @@ -78,3 +78,10 @@ class TestHasPermsDecorator(TestCase): request = TestHasPermsDecorator.check_user_perms_func(None, context=context) self.assertEqual(request.status_code, 403) self.assertEqual(request.content, 'Forbidden. User without access') + + + def test_user_without_context(self): + context = type('Mock', (object,), dict()) + request = TestHasPermsDecorator.check_user_perms_func(None, context=context) + self.assertEqual(request.status_code, 403) + self.assertEqual(request.content, 'Forbidden. No context, no access.')