Code

Ticket #8523: 8523.remove_unneeded_setupteardown_in_auth_tests.diff

File 8523.remove_unneeded_setupteardown_in_auth_tests.diff, 1.2 KB (added by mtrichardson, 6 years ago)

Remove improper setUp/tearDown methods on ChangePasswordTest

Line 
1Index: django/contrib/auth/tests/views.py
2===================================================================
3--- django/contrib/auth/tests/views.py  (revision 8521)
4+++ django/contrib/auth/tests/views.py  (working copy)
5@@ -94,18 +94,6 @@
6     fixtures = ['authtestdata.json']
7     urls = 'django.contrib.auth.urls'
8 
9-    def setUp(self):
10-        self.old_TEMPLATE_DIRS = settings.TEMPLATE_DIRS
11-        settings.TEMPLATE_DIRS = (
12-            os.path.join(
13-                os.path.dirname(__file__),
14-                'templates'
15-            )
16-        ,)
17-
18-    def tearDown(self):
19-        settings.TEMPLATE_DIRS = self.old_TEMPLATE_DIRS
20-
21     def login(self, password='password'):
22         response = self.client.post('/login/', {
23             'username': 'testclient',
24@@ -124,9 +112,6 @@
25         self.assertEquals(response.status_code, 200)
26         self.assert_("Please enter a correct username and password. Note that both fields are case-sensitive." in response.content)
27 
28-    def logout(self):
29-        response = self.client.get('/logout/')
30-
31     def test_password_change_fails_with_invalid_old_password(self):
32         self.login()
33         response = self.client.post('/password_change/', {