Ticket #11133: 11133.patch

File 11133.patch, 989 bytes (added by Henrik Vendelbo, 16 years ago)
  • django/contrib/auth/tests/views.py

    diff --git a/django/contrib/auth/tests/views.py b/django/contrib/auth/tests/views.py
    index 532f92b..73b0e26 100644
    a b class LoginTest(AuthViewsTestCase):  
    188188    def test_current_site_in_context_after_login(self):
    189189        response = self.client.get(reverse('django.contrib.auth.views.login'))
    190190        self.assertEquals(response.status_code, 200)
    191         site = Site.objects.get_current()
    192         self.assertEquals(response.context['site'], site)
    193         self.assertEquals(response.context['site_name'], site.name)
     191        if Site._meta.installed:
     192            site = Site.objects.get_current()
     193            self.assertEquals(response.context['site'], site)
     194            self.assertEquals(response.context['site_name'], site.name)
    194195        self.assert_(isinstance(response.context['form'], AuthenticationForm),
    195196                     'Login form is not an AuthenticationForm')
    196197       
Back to Top