From 2681f6340c6af6fdb6e3f6311a20579237d289a2 Mon Sep 17 00:00:00 2001 From: Scott Sadler Date: Fri, 6 Nov 2015 15:22:44 +0100 Subject: [PATCH] fix reload_urlconf test helper so it supports a third party urlconf --- helpdesk/tests/helpers.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/helpdesk/tests/helpers.py b/helpdesk/tests/helpers.py index 6dccad08..67715c90 100644 --- a/helpdesk/tests/helpers.py +++ b/helpdesk/tests/helpers.py @@ -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'