summaryrefslogtreecommitdiff
path: root/tests/auth_tests
diff options
context:
space:
mode:
authorSimon Charette <charette.s@gmail.com>2018-11-23 21:24:25 -0500
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2020-05-15 20:22:56 +0200
commit94f63b926fd32d7a7b6e2591ef72aa8f040f25cc (patch)
tree427aa4855f08fa75d386118765fcb0035ea07052 /tests/auth_tests
parent3cf80d3fcf7446afdde16a2be515c423f720e54d (diff)
Refs #31395 -- Relied on setUpTestData() test data isolation in various tests.
Diffstat (limited to 'tests/auth_tests')
-rw-r--r--tests/auth_tests/test_middleware.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/auth_tests/test_middleware.py b/tests/auth_tests/test_middleware.py
index 5538225acb..fb23ed9fba 100644
--- a/tests/auth_tests/test_middleware.py
+++ b/tests/auth_tests/test_middleware.py
@@ -6,8 +6,11 @@ from django.test import TestCase
class TestAuthenticationMiddleware(TestCase):
+ @classmethod
+ def setUpTestData(cls):
+ cls.user = User.objects.create_user('test_user', 'test@example.com', 'test_password')
+
def setUp(self):
- self.user = User.objects.create_user('test_user', 'test@example.com', 'test_password')
self.middleware = AuthenticationMiddleware(lambda req: HttpResponse())
self.client.force_login(self.user)
self.request = HttpRequest()