We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5f33d32 commit 5ba248bCopy full SHA for 5ba248b
pytest_django/plugin.py
@@ -314,7 +314,7 @@ def _django_set_urlconf(request):
314
if marker:
315
skip_if_no_django()
316
import django.conf
317
- from django.core.urlresolvers import clear_url_caches
+ from django.core.urlresolvers import clear_url_caches, set_urlconf
318
319
validate_urls(marker)
320
original_urlconf = django.conf.settings.ROOT_URLCONF
@@ -323,6 +323,10 @@ def _django_set_urlconf(request):
323
324
def restore():
325
django.conf.settings.ROOT_URLCONF = original_urlconf
326
+ # Copy the pattern from
327
+ # https://github.com/django/django/blob/master/django/test/signals.py#L152
328
+ clear_url_caches()
329
+ set_urlconf(None)
330
331
request.addfinalizer(restore)
332
0 commit comments