def test_get_warning_for_invalid_pattern_string(self): warning = get_warning_for_invalid_pattern('')[0] self.assertEqual( warning.hint, "Try removing the string ''. The list of urlpatterns should " "not have a prefix string as the first element.", )
def test_get_warning_for_invalid_pattern_string(self): warning = get_warning_for_invalid_pattern('')[0] self.assertEqual( warning.hint, "Try removing the string ''. The list of urlpatterns should " "not have a prefix string as the first element.", )
def test_get_warning_for_invalid_pattern_other(self): warning = get_warning_for_invalid_pattern(object())[0] self.assertIsNone(warning.hint)
def test_get_warning_for_invalid_pattern_tuple(self): warning = get_warning_for_invalid_pattern((r'^$', lambda x: x))[0] self.assertEqual(warning.hint, "Try using path() instead of a tuple.")
def test_get_warning_for_invalid_pattern_other(self): warning = get_warning_for_invalid_pattern(object())[0] self.assertIsNone(warning.hint)
def test_get_warning_for_invalid_pattern_tuple(self): warning = get_warning_for_invalid_pattern((r'^$', lambda x: x))[0] self.assertEqual(warning.hint, "Try using path() instead of a tuple.")