def _resolve_urlpatterns(self, urlpatterns, test_paths):
        factory = APIRequestFactory()
        try:
            urlpatterns = format_suffix_patterns(urlpatterns)
        except Exception:
            self.fail("Failed to apply `format_suffix_patterns` on  the supplied urlpatterns")
        resolver = urlresolvers.RegexURLResolver(r'^/', urlpatterns)
        for test_path in test_paths:
            request = factory.get(test_path.path)
            try:
                callback, callback_args, callback_kwargs = resolver.resolve(request.path_info)
            except Exception:
                self.fail("Failed to resolve URL: %s" % request.path_info)
            self.assertEqual(callback_args, test_path.args)
            self.assertEqual(callback_kwargs, test_path.kwargs)
dataset/ETHPy150Open tomchristie/django-rest-framework/tests/test_urlpatterns.py/FormatSuffixTests._resolve_urlpatterns/original