summaryrefslogtreecommitdiff
path: root/tests/modeladmin
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2018-01-03 13:24:02 -0500
committerGitHub <noreply@github.com>2018-01-03 13:24:02 -0500
commitacc8dd4142ec81def9a73507120c0262ba6b1264 (patch)
treeb23afef0de9b19a50e96fd8706c763386419d79d /tests/modeladmin
parentd79cf1e9e2887aa12567c8f27e384195253cb847 (diff)
downloaddjango-acc8dd4142ec81def9a73507120c0262ba6b1264.tar.gz
Fixed #28984 -- Made assorted code simplifications.
Diffstat (limited to 'tests/modeladmin')
-rw-r--r--tests/modeladmin/tests.py16
1 files changed, 4 insertions, 12 deletions
diff --git a/tests/modeladmin/tests.py b/tests/modeladmin/tests.py
index 67bed3d697..202929df05 100644
--- a/tests/modeladmin/tests.py
+++ b/tests/modeladmin/tests.py
@@ -671,27 +671,19 @@ class ModelAdminPermissionTests(SimpleTestCase):
class MockUser:
def has_module_perms(self, app_label):
- if app_label == "modeladmin":
- return True
- return False
+ return app_label == 'modeladmin'
class MockAddUser(MockUser):
def has_perm(self, perm):
- if perm == "modeladmin.add_band":
- return True
- return False
+ return perm == 'modeladmin.add_band'
class MockChangeUser(MockUser):
def has_perm(self, perm):
- if perm == "modeladmin.change_band":
- return True
- return False
+ return perm == 'modeladmin.change_band'
class MockDeleteUser(MockUser):
def has_perm(self, perm):
- if perm == "modeladmin.delete_band":
- return True
- return False
+ return perm == 'modeladmin.delete_band'
def test_has_add_permission(self):
"""