Index view should correctly resolve view patterns when ROOT_URLCONF is not a string.
(self)
| 191 | self.assertContains(response, "View documentation") |
| 192 | |
| 193 | def test_callable_urlconf(self): |
| 194 | """ |
| 195 | Index view should correctly resolve view patterns when ROOT_URLCONF is |
| 196 | not a string. |
| 197 | """ |
| 198 | |
| 199 | def urlpatterns(): |
| 200 | return ( |
| 201 | path("admin/doc/", include("django.contrib.admindocs.urls")), |
| 202 | path("admin/", admin.site.urls), |
| 203 | ) |
| 204 | |
| 205 | with self.settings(ROOT_URLCONF=SimpleLazyObject(urlpatterns)): |
| 206 | response = self.client.get(reverse("django-admindocs-views-index")) |
| 207 | self.assertEqual(response.status_code, 200) |
| 208 | |
| 209 | |
| 210 | @unittest.skipUnless(utils.docutils_is_available, "no docutils installed.") |
nothing calls this directly
no test coverage detected