mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
Fixed #26264 -- Fixed prefetch_related() crashes with values_list(flat=True)
This commit is contained in:
@@ -44,6 +44,17 @@ class UUIDPrefetchRelated(TestCase):
|
||||
with self.assertNumQueries(0):
|
||||
self.assertEqual(2, len(flea.pets_visited.all()))
|
||||
|
||||
def test_prefetch_related_from_uuid_model_to_uuid_model_with_values_flat(self):
|
||||
pet = Pet.objects.create(name='Fifi')
|
||||
pet.people.add(
|
||||
Person.objects.create(name='Ellen'),
|
||||
Person.objects.create(name='George'),
|
||||
)
|
||||
self.assertSequenceEqual(
|
||||
Pet.objects.prefetch_related('fleas_hosted').values_list('id', flat=True),
|
||||
[pet.id]
|
||||
)
|
||||
|
||||
|
||||
class UUIDPrefetchRelatedLookups(TestCase):
|
||||
|
||||
|
||||
Reference in New Issue
Block a user