1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Refs #33476 -- Refactored code to strictly match 88 characters line length.

This commit is contained in:
Mariusz Felisiak
2022-02-04 08:08:27 +01:00
parent 9c19aff7c7
commit 7119f40c98
404 changed files with 5944 additions and 2842 deletions

View File

@@ -88,19 +88,28 @@ class GetObjectOr404Tests(TestCase):
def test_bad_class(self):
# Given an argument klass that is not a Model, Manager, or Queryset
# raises a helpful ValueError message
msg = "First argument to get_object_or_404() must be a Model, Manager, or QuerySet, not 'str'."
msg = (
"First argument to get_object_or_404() must be a Model, Manager, or "
"QuerySet, not 'str'."
)
with self.assertRaisesMessage(ValueError, msg):
get_object_or_404("Article", title__icontains="Run")
class CustomClass:
pass
msg = "First argument to get_object_or_404() must be a Model, Manager, or QuerySet, not 'CustomClass'."
msg = (
"First argument to get_object_or_404() must be a Model, Manager, or "
"QuerySet, not 'CustomClass'."
)
with self.assertRaisesMessage(ValueError, msg):
get_object_or_404(CustomClass, title__icontains="Run")
# Works for lists too
msg = "First argument to get_list_or_404() must be a Model, Manager, or QuerySet, not 'list'."
msg = (
"First argument to get_list_or_404() must be a Model, Manager, or "
"QuerySet, not 'list'."
)
with self.assertRaisesMessage(ValueError, msg):
get_list_or_404([Article], title__icontains="Run")