mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-02 11:30:12 +03:00
wip: support for app_name in URLPatternsTestCase
This commit is contained in:
parent
66307c5cfd
commit
1d161687a2
|
@ -385,9 +385,14 @@ class URLPatternsTestCase(testcases.SimpleTestCase):
|
|||
|
||||
if hasattr(cls._module, 'urlpatterns'):
|
||||
cls._module_urlpatterns = cls._module.urlpatterns
|
||||
if hasattr(cls._module, 'app_name'):
|
||||
cls._module_app_name = cls._module.app_name
|
||||
|
||||
cls._module.urlpatterns = cls.urlpatterns
|
||||
|
||||
if hasattr(cls, 'app_name'):
|
||||
cls._module.app_name = cls.app_name
|
||||
|
||||
cls._override.enable()
|
||||
super(URLPatternsTestCase, cls).setUpClass()
|
||||
|
||||
|
@ -400,3 +405,9 @@ class URLPatternsTestCase(testcases.SimpleTestCase):
|
|||
cls._module.urlpatterns = cls._module_urlpatterns
|
||||
else:
|
||||
del cls._module.urlpatterns
|
||||
|
||||
if hasattr(cls, '_module_app_name'):
|
||||
cls._module.app_name = cls._module_app_name
|
||||
else:
|
||||
if hasattr(cls._module, 'app_name'):
|
||||
del cls._module.app_name
|
||||
|
|
Loading…
Reference in New Issue
Block a user