1
0
mirror of https://github.com/django/django.git synced 2024-12-22 17:16:24 +00:00

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

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):