Kaydet (Commit) fae551d7 authored tarafından Claude Paroz's avatar Claude Paroz

Complemented pickle test for ValuesQuerySet with related field

Refs #14515.
üst 7ce9644d
......@@ -46,6 +46,7 @@ class Group(models.Model):
class Event(models.Model):
title = models.CharField(max_length=100)
group = models.ForeignKey(Group)
......
......@@ -100,6 +100,11 @@ class PickleabilityTestCase(TestCase):
self.assert_pickles(Happening.objects.values('name'))
self.assert_pickles(Happening.objects.values('name').dates('when', 'year'))
# ValuesQuerySet with related field (#14515)
self.assert_pickles(
Event.objects.select_related('group').order_by('title').values_list('title', 'group__name')
)
def test_pickle_prefetch_related_idempotence(self):
g = Group.objects.create(name='foo')
groups = Group.objects.prefetch_related('event_set')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment