From acc8dd4142ec81def9a73507120c0262ba6b1264 Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Wed, 3 Jan 2018 13:24:02 -0500 Subject: Fixed #28984 -- Made assorted code simplifications. --- tests/modeladmin/tests.py | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'tests/modeladmin') 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): """ -- cgit v1.3