mirror of
https://github.com/django/django.git
synced 2025-08-03 10:34:04 +00:00
Fixed #26264 -- Fixed prefetch_related() crashes with values_list(flat=True)
This commit is contained in:
parent
3389c5ea22
commit
5e2c4d7afb
2 changed files with 17 additions and 5 deletions
|
@ -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):
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue