Ticket #26428: 26428-test.diff

File 26428-test.diff, 1.1 KB (added by Tim Graham, 8 years ago)
  • tests/test_client/tests.py

    diff --git a/tests/test_client/tests.py b/tests/test_client/tests.py
    index 6a6b5d3..8ae0682 100644
    a b class ClientTest(TestCase):  
    623623        # Check some response details
    624624        self.assertContains(response, 'This is a test')
    625625
     626    def test_relative_redirect(self):
     627        response = self.client.get('/accounts/')
     628        self.assertRedirects(response, '/accounts/login/')
     629
    626630    def test_mass_mail_sending(self):
    627631        "Test that mass mail is redirected to a dummy outbox during test setup"
    628632
  • tests/test_client/urls.py

    diff --git a/tests/test_client/urls.py b/tests/test_client/urls.py
    index f605448..32128d8 100644
    a b urlpatterns = [  
    3434    url(r'^nesting_exception_view/$', views.nesting_exception_view),
    3535    url(r'^django_project_redirect/$', views.django_project_redirect),
    3636
     37    url(r'^accounts/$', RedirectView.as_view(url='login/')),
    3738    url(r'^accounts/login/$', auth_views.login, {'template_name': 'login.html'}),
    3839    url(r'^accounts/logout/$', auth_views.logout),
    3940]
Back to Top