summaryrefslogtreecommitdiff
path: root/tests/get_object_or_404
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2016-03-27 22:35:57 +0200
committerClaude Paroz <claude@2xlibre.net>2016-03-29 21:34:20 +0200
commit12ba20d83c8faa51823e1471ab35fb46688ca577 (patch)
tree431e254eb2338cbf17603827be837ae916d5836e /tests/get_object_or_404
parent4b2cf1cd27587a30b3b081091627d7ee13141afe (diff)
downloaddjango-12ba20d83c8faa51823e1471ab35fb46688ca577.tar.gz
Fixed #10532 -- Relaxed hard-type checking in get_object/list_or_404 shortcuts
Thanks Anssi Kääriäinen for the patch suggestion, and Tim Graham for the review.
Diffstat (limited to 'tests/get_object_or_404')
-rw-r--r--tests/get_object_or_404/tests.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/get_object_or_404/tests.py b/tests/get_object_or_404/tests.py
index ac4b2d4738..bf10ea3109 100644
--- a/tests/get_object_or_404/tests.py
+++ b/tests/get_object_or_404/tests.py
@@ -81,18 +81,18 @@ 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 = "Object is of type 'str', but must be a Django Model, Manager, or QuerySet"
+ 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(str("Article"), title__icontains="Run")
class CustomClass(object):
pass
- msg = "Object is of type 'CustomClass', but must be a Django Model, Manager, or QuerySet"
+ 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 = "Object is of type 'list', but must be a Django Model, Manager, or QuerySet"
+ 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")