mirror of https://github.com/django/django.git
parent
c89d80e2cc
commit
74b91b3888
|
@ -94,3 +94,15 @@ class PickleabilityTestCase(TestCase):
|
|||
def test_specialized_queryset(self):
|
||||
self.assert_pickles(Happening.objects.values('name'))
|
||||
self.assert_pickles(Happening.objects.values('name').dates('when', 'year'))
|
||||
|
||||
def test_pickle_prefetch_related_idempotence(self):
|
||||
g = Group.objects.create(name='foo')
|
||||
groups = Group.objects.prefetch_related('event_set')
|
||||
|
||||
# First pickling
|
||||
groups = pickle.loads(pickle.dumps(groups))
|
||||
self.assertQuerysetEqual(groups, [g], lambda x: x)
|
||||
|
||||
# Second pickling
|
||||
groups = pickle.loads(pickle.dumps(groups))
|
||||
self.assertQuerysetEqual(groups, [g], lambda x: x)
|
||||
|
|
Loading…
Reference in New Issue