Ticket #10747: 10747.diff

File 10747.diff, 2.5 KB (added by Matthew Flanagan <mattimustang@…>, 6 years ago)

fix for logout test failing

  • django/contrib/auth/tests/views.py

     
    205205    def test_logout_default(self):
    206206        "Logout without next_page option renders the default template"
    207207        self.login()
    208         response = self.client.get('/logout/')
     208        response = self.client.get('/logout_test/')
    209209        self.assertEquals(200, response.status_code)
    210210        self.assert_('Logged out' in response.content)
    211211        self.confirm_logged_out()
     
    221221    def test_logout_with_redirect_argument(self):
    222222        "Logout with query string redirects to specified resource"
    223223        self.login()
    224         response = self.client.get('/logout/?next=/login/')
     224        response = self.client.get('/logout_test/?next=/login/')
    225225        self.assertEqual(response.status_code, 302)
    226226        self.assert_(response['Location'].endswith('/login/'))
    227227        self.confirm_logged_out()
     
    232232        response = self.client.get('/logout/custom_query/?follow=/somewhere/')
    233233        self.assertEqual(response.status_code, 302)
    234234        self.assert_(response['Location'].endswith('/somewhere/'))
    235         self.confirm_logged_out()
    236  No newline at end of file
     235        self.confirm_logged_out()
  • django/contrib/auth/tests/urls.py

     
    1 from django.conf.urls.defaults import patterns
     1from django.conf.urls.defaults import *
    22from django.contrib.auth.urls import urlpatterns
    33
    44# special urls for auth test cases
    55urlpatterns += patterns('',
    66    (r'^logout/custom_query/$', 'django.contrib.auth.views.logout', dict(redirect_field_name='follow')),
    77    (r'^logout/next_page/$', 'django.contrib.auth.views.logout', dict(next_page='/somewhere/')),
     8    (r'^logout_test/$', 'django.contrib.auth.views.logout', dict(template_name='auth_test/logged_out.html')),
    89)
    910
  • django/contrib/auth/tests/templates/auth_test/logged_out.html

     
     1Logged out
Back to Top