MCPcopy
hub / github.com/django/django / test_view_function

Method test_view_function

tests/resolve_url/tests.py:45–51  ·  view source on GitHub ↗

Passing a view function to resolve_url() results in the URL path mapping to that view name.

(self)

Source from the content-addressed store, hash-verified

43 self.assertEqual(m.get_absolute_url(), resolve_url(m))
44
45 def test_view_function(self):
46 """
47 Passing a view function to resolve_url() results in the URL path
48 mapping to that view name.
49 """
50 resolved_url = resolve_url(some_view)
51 self.assertEqual("/some-url/", resolved_url)
52
53 def test_view_function_with_kwargs(self):
54 self.assertEqual("/params/django/", resolve_url(params_view, slug="django"))

Callers

nothing calls this directly

Calls 1

resolve_urlFunction · 0.90

Tested by

no test coverage detected