mirror of
https://github.com/django/django.git
synced 2025-10-24 22:26:08 +00:00
Refs #31395 -- Relied on setUpTestData() test data isolation in various tests.
This commit is contained in:
committed by
Mariusz Felisiak
parent
3cf80d3fcf
commit
94f63b926f
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user