Ticket #12082: views.py.diff

File views.py.diff, 1.0 KB (added by Farhan Ahmad, 15 years ago)
  • django/contrib/auth/tests/views.py

     
    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)
     195        else:
     196            self.assertEquals(response.context['site_name'], 'testserver')
    194197        self.assert_(isinstance(response.context['form'], AuthenticationForm),
    195198                     'Login form is not an AuthenticationForm')
    196199       
Back to Top