diff options
| author | Carlton Gibson | 2014-09-01 10:31:07 +0200 |
|---|---|---|
| committer | Carlton Gibson | 2014-09-01 10:31:07 +0200 |
| commit | 14877464f66600ab89567f846cfd98c7200437e9 (patch) | |
| tree | 542293e19fd454df7af3c63f3ffc33c2761d3275 /tests/test_authentication.py | |
| parent | 55e779c856347094e3240bc7bf83927acf0bd442 (diff) | |
| parent | 0e51dab8f4cdfeb05b7c70a0ca74ffa90d01f512 (diff) | |
| download | django-rest-framework-14877464f66600ab89567f846cfd98c7200437e9.tar.bz2 | |
Merge pull request #1816 from carltongibson/regression-login-template
Regression for #1810: Test login view renders
Diffstat (limited to 'tests/test_authentication.py')
| -rw-r--r-- | tests/test_authentication.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/test_authentication.py b/tests/test_authentication.py index 2b9d73e4..32041f9c 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,15 @@ 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. |
