summaryrefslogtreecommitdiff
path: root/tests/get_object_or_404
diff options
context:
space:
mode:
Diffstat (limited to 'tests/get_object_or_404')
-rw-r--r--tests/get_object_or_404/tests.py15
1 files changed, 12 insertions, 3 deletions
diff --git a/tests/get_object_or_404/tests.py b/tests/get_object_or_404/tests.py
index 4f2566a3a4..7f83c2c7a2 100644
--- a/tests/get_object_or_404/tests.py
+++ b/tests/get_object_or_404/tests.py
@@ -70,19 +70,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")