Skip to content

Commit 477c291

Browse files
committed
Second attempt
1 parent b447fde commit 477c291

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

readthedocs/proxito/tests/test_middleware.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,12 +163,11 @@ def setUp(self):
163163
urlconf='subpath/to/$version/$language/$filename' # Flipped
164164
)
165165

166-
self.old_urlconf = get_urlconf()
167166
sys.modules['fake_urlconf'] = self.pip.proxito_urlconf
168167
set_urlconf('fake_urlconf')
169168

170169
def tearDown(self):
171-
set_urlconf(self.old_urlconf)
170+
set_urlconf(None)
172171

173172
def test_proxied_api_methods(self):
174173
# This is mostly a unit test, but useful to make sure the below tests work
@@ -238,10 +237,12 @@ def setUp(self):
238237
child=self.subproject,
239238
)
240239

241-
self.old_urlconf = get_urlconf()
242240
sys.modules['fake_urlconf'] = self.pip.proxito_urlconf
243241
set_urlconf('fake_urlconf')
244242

243+
def tearDown(self):
244+
set_urlconf(None)
245+
245246
def test_middleware_urlconf_subproject(self):
246247
resp = self.client.get('/subpath/subproject/testing/en/foodex.html', HTTP_HOST=self.domain)
247248
self.assertEqual(resp.status_code, 200)

0 commit comments

Comments
 (0)