Skip to content

Commit

Permalink
Added test for ResolverMatch.__repr__().
Browse files Browse the repository at this point in the history
  • Loading branch information
xavfernandez authored and timgraham committed Nov 30, 2018
1 parent 9d334e0 commit 4d9f51f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/urlpatterns_reverse/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -1125,6 +1125,14 @@ def test_resolver_match_on_request_before_resolution(self):
request = HttpRequest()
self.assertIsNone(request.resolver_match)

def test_repr(self):
self.assertEqual(
repr(resolve('/no_kwargs/42/37/')),
"ResolverMatch(func=urlpatterns_reverse.views.empty_view, "
"args=('42', '37'), kwargs={}, url_name=no-kwargs, app_names=[], "
"namespaces=[])"
)


@override_settings(ROOT_URLCONF='urlpatterns_reverse.erroneous_urls')
class ErroneousViewTests(SimpleTestCase):
Expand Down

0 comments on commit 4d9f51f

Please sign in to comment.