Skip to content

Commit

Permalink
Fixed a test failure due to Django 1.8 TestCase change.
Browse files Browse the repository at this point in the history
Django 1.8 no longer resets the URLconf before each test class.
django/django@d89f56d#diff-5d7d8ead1a907fe91ffc121f830f2a49L229
  • Loading branch information
timgraham committed Apr 1, 2015
1 parent 9974176 commit 6954642
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions docs/tests.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from django.contrib.sites.models import Site
from django.core.urlresolvers import set_urlconf
from django.test import TestCase


Expand All @@ -9,6 +10,12 @@ def setUp(self):
# We need to create an extra Site because docs have SITE_ID=2
Site.objects.create(name='Django test', domain="example.com")

@classmethod
def tearDownClass(cls):
# cleanup URLconfs changed by django-hosts
set_urlconf(None)
super(SearchFormTestCase, cls).tearDownClass()

def test_empty_get(self):
response = self.client.get('/en/dev/search/',
HTTP_HOST='docs.djangoproject.dev:8000')
Expand Down

0 comments on commit 6954642

Please sign in to comment.