mirror of
https://github.com/django/django.git
synced 2025-08-04 10:59:45 +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:
parent
8a47ba679d
commit
7ec330eeb9
2 changed files with 6 additions and 0 deletions
|
@ -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):
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue