aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_authentication.py
diff options
context:
space:
mode:
authorCarlton Gibson2014-09-01 10:07:05 +0200
committerCarlton Gibson2014-09-01 10:07:05 +0200
commit1c9c5d5c32656231acf5f14b5231f9274a2eb254 (patch)
tree587509bfe8065b76fd6bd6ffaa3b3ecec71050c8 /tests/test_authentication.py
parentf777a73bc7987330c69c18bd37634942a67f4e74 (diff)
downloaddjango-rest-framework-1c9c5d5c32656231acf5f14b5231f9274a2eb254.tar.bz2
Regression for #1810: Test login view renders
Diffstat (limited to 'tests/test_authentication.py')
-rw-r--r--tests/test_authentication.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/tests/test_authentication.py b/tests/test_authentication.py
index 2b9d73e4..8294189e 100644
--- a/tests/test_authentication.py
+++ b/tests/test_authentication.py
@@ -57,7 +57,8 @@ urlpatterns = patterns(
authentication_classes=[OAuthAuthentication],
permission_classes=[permissions.TokenHasReadWriteScope]
)
- )
+ ),
+ url(r'^auth/', include('rest_framework.urls', namespace='rest_framework'))
)
@@ -134,6 +135,16 @@ class SessionAuthTests(TestCase):
def tearDown(self):
self.csrf_client.logout()
+ def test_login_view_renders_on_get(self):
+ """
+ Ensure the login template renders for a basic GET.
+
+ cf. [#1810](https://github.com/tomchristie/django-rest-framework/pull/1810)
+ """
+ response = self.csrf_client.get('/auth/login/')
+ self.assertContains(response, '<Label class="span4">Username:</label>')
+
+
def test_post_form_session_auth_failing_csrf(self):
"""
Ensure POSTing form over session authentication without CSRF token fails.