mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
Refs #26565 -- Errored nicely when using Prefetch with a values() queryset.
Thanks Maxime Lorant for the report and Anssi for the suggestion.
This commit is contained in:
@@ -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):
|
||||
|
||||
|
||||
Reference in New Issue
Block a user