Skip to content

Commit 043561b

Browse files
committed
wip: support for app_name in URLPatternsTestCase
1 parent d3ba90a commit 043561b

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

rest_framework/test.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,9 +385,14 @@ def setUpClass(cls):
385385

386386
if hasattr(cls._module, 'urlpatterns'):
387387
cls._module_urlpatterns = cls._module.urlpatterns
388+
if hasattr(cls._module, 'app_name'):
389+
cls._module_app_name = cls._module.app_name
388390

389391
cls._module.urlpatterns = cls.urlpatterns
390392

393+
if hasattr(cls, 'app_name'):
394+
cls._module.app_name = cls.app_name
395+
391396
cls._override.enable()
392397
super(URLPatternsTestCase, cls).setUpClass()
393398

@@ -400,3 +405,9 @@ def tearDownClass(cls):
400405
cls._module.urlpatterns = cls._module_urlpatterns
401406
else:
402407
del cls._module.urlpatterns
408+
409+
if hasattr(cls, '_module_app_name'):
410+
cls._module.app_name = cls._module_app_name
411+
else:
412+
if hasattr(cls._module, 'app_name'):
413+
del cls._module.app_name

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy