Fixed issue with 'django.contrib.auth.views.login' not being reversed properly

This commit is contained in:
Karl Hobley 2014-06-06 12:59:07 +01:00
parent b35f6d9409
commit 45a10979c6
2 changed files with 7 additions and 1 deletions

View file

@ -92,7 +92,6 @@ class TestAuthentication(TestCase, WagtailTestUtils):
self.assertEqual(response.status_code, 302)
self.assertURLEqual(response.url, reverse('wagtailadmin_login') + '?next=' + reverse('wagtailadmin_home'))
@unittest.expectedFailure
def test_not_logged_in_redirect_default_settings(self):
"""
This does the same as the above test but checks that it

View file

@ -84,6 +84,13 @@ urlpatterns += [
]
# This is here to make sure that 'django.contrib.auth.views.login' is reversed correctly
# It must be placed after 'wagtailadmin_login' to prevent this from being used
urlpatterns += [
url(r'^login/$', 'django.contrib.auth.views.login'),
]
# Import additional urlpatterns from any apps that define a register_admin_urls hook
for fn in hooks.get_hooks('register_admin_urls'):
urls = fn()