diff --git a/readthedocs/rtd_tests/tests/test_subprojects.py b/readthedocs/rtd_tests/tests/test_subprojects.py index 5e86fad0ef1..96487599a24 100644 --- a/readthedocs/rtd_tests/tests/test_subprojects.py +++ b/readthedocs/rtd_tests/tests/test_subprojects.py @@ -3,6 +3,7 @@ import mock import django_dynamic_fixture as fixture from django.contrib.auth.models import User +from django.core.urlresolvers import reverse, set_urlconf from django.test import TestCase from django.test.utils import override_settings @@ -185,6 +186,12 @@ def setUp(self): relation.save() fixture.get(Project, slug='sub_alias', language='ya') + def tearDown(self): + # The urlconf value is preserved for the current thread, + # (is modified to ``readthedocs.core.urls.subdomain``) + # this causes errors when using the reverse function. + # This method call deletes that setting. + set_urlconf(None) @override_settings( PRODUCTION_DOMAIN='readthedocs.org',