From 1faa41c63cd323636c6e9b0358babadff9346c53 Mon Sep 17 00:00:00 2001 From: Carlos Martinez Date: Thu, 26 Oct 2017 12:14:40 -0500 Subject: [PATCH] Clean code --- graphene_django/auth/decorators.py | 1 - graphene_django/tests/test_auth.py | 11 ++++------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/graphene_django/auth/decorators.py b/graphene_django/auth/decorators.py index f0cbfb4..a211219 100644 --- a/graphene_django/auth/decorators.py +++ b/graphene_django/auth/decorators.py @@ -34,7 +34,6 @@ def connection_require_permission(permissions): cls, resolver, connection, default_manager, max_limit, enforce_first_or_last, root, info, **args): if has_perm(permissions=permissions, context=info.context): - print("Has Perms") return func( cls, resolver, connection, default_manager, max_limit, enforce_first_or_last, root, info, **args) diff --git a/graphene_django/tests/test_auth.py b/graphene_django/tests/test_auth.py index 7adb883..a875bf3 100644 --- a/graphene_django/tests/test_auth.py +++ b/graphene_django/tests/test_auth.py @@ -37,11 +37,8 @@ class MockUserContext(object): return self.authenticated def has_perm(self, check_perms): - print(self.username, self.perms) if check_perms not in self.perms: - print("NO PERMS") return False - print("HAS PERMS") return True @@ -145,7 +142,7 @@ def test_node_anonymous_user(): def get_node(cls, info, id): return super(ReporterType, cls).get_node(info, id) - r = Reporter.objects.create( + Reporter.objects.create( first_name='John', last_name='Doe', email='johndoe@example.com', @@ -184,7 +181,7 @@ def test_node_no_context(): def get_node(cls, info, id): return super(ReporterType, cls).get_node(info, id) - r = Reporter.objects.create( + Reporter.objects.create( first_name='John', last_name='Doe', email='johndoe@example.com', @@ -221,7 +218,7 @@ def test_node_authenticated_user_no_permissions(): def get_node(cls, info, id): return super(ReporterType, cls).get_node(info, id) - r = Reporter.objects.create( + Reporter.objects.create( first_name='John', last_name='Doe', email='johndoe@example.com', @@ -260,7 +257,7 @@ def test_node_authenticated_user_with_permissions(): def get_node(cls, info, id): return super(ReporterType, cls).get_node(info, id) - r = Reporter.objects.create( + Reporter.objects.create( first_name='John', last_name='Doe', email='johndoe@example.com',