Added test for ResolverMatch.__repr__().

This commit is contained in:
Xavier Fernandez 2018-11-28 14:17:01 -05:00 committed by Tim Graham
parent 9d334e0a7a
commit 4d9f51f2b5
1 changed files with 8 additions and 0 deletions

View File

@ -1125,6 +1125,14 @@ class ResolverMatchTests(SimpleTestCase):
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):