mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
Fixed #12769, #12924 -- Corrected the pickling of curried and lazy objects, which was preventing queries with translated or related fields from being pickled. And lo, Alex Gaynor didst slayeth the dragon.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12866 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
14
tests/regressiontests/queryset_pickle/tests.py
Normal file
14
tests/regressiontests/queryset_pickle/tests.py
Normal file
@@ -0,0 +1,14 @@
|
||||
import pickle
|
||||
|
||||
from django.test import TestCase
|
||||
|
||||
from models import Group, Event
|
||||
|
||||
|
||||
class PickleabilityTestCase(TestCase):
|
||||
def assert_pickles(self, qs):
|
||||
self.assertEqual(list(pickle.loads(pickle.dumps(qs))), list(qs))
|
||||
|
||||
def test_related_field(self):
|
||||
g = Group.objects.create(name="Ponies Who Own Maybachs")
|
||||
self.assert_pickles(Event.objects.filter(group=g.id))
|
||||
Reference in New Issue
Block a user