mirror of
https://github.com/django-helpdesk/django-helpdesk.git
synced 2025-01-19 12:29:34 +01:00
Add a test that checks that LOGIN_URL can be a view name
This test requires that the admin urls are added to the test configuration.
This commit is contained in:
parent
0a43b9a160
commit
042e766be1
@ -35,3 +35,11 @@ class TestLoginRedirect(TestCase):
|
|||||||
"""Test that default login is used when LOGIN_URL is None"""
|
"""Test that default login is used when LOGIN_URL is None"""
|
||||||
response = self.client.get(reverse('helpdesk:login'))
|
response = self.client.get(reverse('helpdesk:login'))
|
||||||
self.assertTemplateUsed(response, 'helpdesk/registration/login.html')
|
self.assertTemplateUsed(response, 'helpdesk/registration/login.html')
|
||||||
|
|
||||||
|
@override_settings(LOGIN_URL='admin:login', SITE_ID=1)
|
||||||
|
def test_custom_login_view_with_name(self):
|
||||||
|
"""Test that LOGIN_URL can be a view name"""
|
||||||
|
response = self.client.get(reverse('helpdesk:login'))
|
||||||
|
home_url = reverse('helpdesk:home')
|
||||||
|
expected = reverse('admin:login') + "?next=" + home_url
|
||||||
|
self.assertRedirects(response, expected)
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
from django.conf.urls import include, url
|
from django.conf.urls import include, url
|
||||||
|
from django.contrib import admin
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
url(r'^helpdesk/', include('helpdesk.urls', namespace='helpdesk')),
|
url(r'^helpdesk/', include('helpdesk.urls', namespace='helpdesk')),
|
||||||
|
url(r'^admin/', admin.site.urls),
|
||||||
]
|
]
|
||||||
|
Loading…
Reference in New Issue
Block a user