Code

Ticket #8523: 8523.prepend_test_templates_to_settings_templates.patch

File 8523.prepend_test_templates_to_settings_templates.patch, 824 bytes (added by cammacrae, 6 years ago)

This patch prepends the test template directory to settings.template_dirs and as a bonus ensures the login method honors settings.LOGIN_REDIRECT_URL

  • django/contrib/auth/tests/views.py

     
    101101                os.path.dirname(__file__), 
    102102                'templates' 
    103103            ) 
    104         ,) 
     104        ,) + tuple(settings.TEMPLATE_DIRS) 
    105105 
    106106    def tearDown(self): 
    107107        settings.TEMPLATE_DIRS = self.old_TEMPLATE_DIRS 
     
    113113            } 
    114114        ) 
    115115        self.assertEquals(response.status_code, 302) 
    116         self.assert_(response['Location'].endswith('/accounts/profile/')) 
     116        self.assert_(response['Location'].endswith(settings.LOGIN_REDIRECT_URL)) 
    117117 
    118118    def fail_login(self, password='password'): 
    119119        response = self.client.post('/login/', {