summaryrefslogtreecommitdiff
path: root/tests/auth_tests/test_context_processors.py
diff options
context:
space:
mode:
authorabhiabhi94 <13880786+abhiabhi94@users.noreply.github.com>2021-05-27 16:48:50 +0530
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2021-05-28 08:03:23 +0200
commit22da686ca93e99f8091334f66d7199bc29b85c83 (patch)
tree15a04c323b83c70d0c78dc8acc2c8aeddc74b8c3 /tests/auth_tests/test_context_processors.py
parent214b36f50aec5ff42776ba847ce33ce08d82ca76 (diff)
Refs #24121 -- Added __repr__() to PermWrapper.
Diffstat (limited to 'tests/auth_tests/test_context_processors.py')
-rw-r--r--tests/auth_tests/test_context_processors.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/auth_tests/test_context_processors.py b/tests/auth_tests/test_context_processors.py
index e492050bcb..98e51a62d9 100644
--- a/tests/auth_tests/test_context_processors.py
+++ b/tests/auth_tests/test_context_processors.py
@@ -9,6 +9,9 @@ from .settings import AUTH_MIDDLEWARE, AUTH_TEMPLATES
class MockUser:
+ def __repr__(self):
+ return 'MockUser()'
+
def has_module_perms(self, perm):
return perm == 'mockapp'
@@ -33,6 +36,10 @@ class PermWrapperTests(SimpleTestCase):
self.eq_calls += 1
return False
+ def test_repr(self):
+ perms = PermWrapper(MockUser())
+ self.assertEqual(repr(perms), 'PermWrapper(MockUser())')
+
def test_permwrapper_in(self):
"""
'something' in PermWrapper works as expected.