fix reload_urlconf test helper so it supports a third party urlconf

This commit is contained in:
Scott Sadler 2015-11-06 15:22:44 +01:00
parent e82c17567a
commit 2681f6340c

View File

@ -26,8 +26,15 @@ def reload_urlconf(urlconf=None):
from django.conf import settings
urlconf = settings.ROOT_URLCONF
if urlconf in sys.modules:
from django.core.urlresolvers import clear_url_caches
if HELPDESK_URLCONF in sys.modules:
reload(sys.modules[HELPDESK_URLCONF])
if urlconf in sys.modules:
reload(sys.modules[urlconf])
clear_url_caches()
from django.core.urlresolvers import clear_url_caches
clear_url_caches()
HELPDESK_URLCONF = 'helpdesk.urls'