MCPcopy
hub / github.com/django/django / test_callable_urlconf

Method test_callable_urlconf

tests/admin_docs/test_views.py:193–207  ·  view source on GitHub ↗

Index view should correctly resolve view patterns when ROOT_URLCONF is not a string.

(self)

Source from the content-addressed store, hash-verified

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.")

Callers

nothing calls this directly

Calls 4

SimpleLazyObjectClass · 0.90
reverseFunction · 0.90
settingsMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected