MCPcopy
hub / github.com/django/django / test_model

Method test_model

tests/resolve_url/tests.py:37–43  ·  view source on GitHub ↗

Passing a model to resolve_url() results in get_absolute_url() being called on that model instance.

(self)

Source from the content-addressed store, hash-verified

35 self.assertEqual(url, resolve_url(url))
36
37 def test_model(self):
38 """
39 Passing a model to resolve_url() results in get_absolute_url() being
40 called on that model instance.
41 """
42 m = UnimportantThing(importance=1)
43 self.assertEqual(m.get_absolute_url(), resolve_url(m))
44
45 def test_view_function(self):
46 """

Callers

nothing calls this directly

Calls 3

get_absolute_urlMethod · 0.95
resolve_urlFunction · 0.90
UnimportantThingClass · 0.85

Tested by

no test coverage detected