summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSimon Charette <charettes@users.noreply.github.com>2016-05-03 09:28:31 -0400
committerSimon Charette <charettes@users.noreply.github.com>2016-05-03 09:28:31 -0400
commit7ec330eeb96d0874949eacb8ed1bbb97e11807e1 (patch)
treeb949c3dc41eb6e432804c454412a2978589e4043 /tests
parent8a47ba679d2da0dee74671a53ba0cd918b433e34 (diff)
Refs #26565 -- Errored nicely when using Prefetch with a values() queryset.
Thanks Maxime Lorant for the report and Anssi for the suggestion.
Diffstat (limited to 'tests')
-rw-r--r--tests/prefetch_related/tests.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/prefetch_related/tests.py b/tests/prefetch_related/tests.py
index ef32320c0a..41eee219b8 100644
--- a/tests/prefetch_related/tests.py
+++ b/tests/prefetch_related/tests.py
@@ -733,6 +733,10 @@ class CustomPrefetchTests(TestCase):
self.assertEqual(str(warns[0].message), msg)
self.assertEqual(str(warns[0].message), msg)
+ def test_values_queryset(self):
+ with self.assertRaisesMessage(ValueError, 'Prefetch querysets cannot use values().'):
+ Prefetch('houses', House.objects.values('pk'))
+
class DefaultManagerTests(TestCase):