URLResolver should raise an exception when no urlpatterns exist.
(self)
| 418 | @override_settings(ROOT_URLCONF="urlpatterns_reverse.no_urls") |
| 419 | class NoURLPatternsTests(SimpleTestCase): |
| 420 | def test_no_urls_exception(self): |
| 421 | """ |
| 422 | URLResolver should raise an exception when no urlpatterns exist. |
| 423 | """ |
| 424 | resolver = URLResolver(RegexPattern(r"^$"), settings.ROOT_URLCONF) |
| 425 | |
| 426 | with self.assertRaisesMessage( |
| 427 | ImproperlyConfigured, |
| 428 | "The included URLconf 'urlpatterns_reverse.no_urls' does not " |
| 429 | "appear to have any patterns in it. If you see the 'urlpatterns' " |
| 430 | "variable with valid patterns in the file then the issue is " |
| 431 | "probably caused by a circular import.", |
| 432 | ): |
| 433 | getattr(resolver, "url_patterns") |
| 434 | |
| 435 | |
| 436 | @override_settings(ROOT_URLCONF="urlpatterns_reverse.urls") |
nothing calls this directly
no test coverage detected