summaryrefslogtreecommitdiff
path: root/tests/get_object_or_404
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2022-02-04 08:08:27 +0100
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2022-02-07 20:37:05 +0100
commit7119f40c9881666b6f9b5cf7df09ee1d21cc8344 (patch)
treefa50869f5614295f462d9bf77fec59365c621609 /tests/get_object_or_404
parent9c19aff7c7561e3a82978a272ecdaad40dda5c00 (diff)
downloaddjango-7119f40c9881666b6f9b5cf7df09ee1d21cc8344.tar.gz
Refs #33476 -- Refactored code to strictly match 88 characters line length.
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 5fdceaa04a..a64900d097 100644
--- a/tests/get_object_or_404/tests.py
+++ b/tests/get_object_or_404/tests.py
@@ -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")