From 155a127afbd531180eaa2fd875fe111178cfb64c Mon Sep 17 00:00:00 2001 From: Anssi Kääriäinen Date: Mon, 23 Feb 2015 09:31:58 +0200 Subject: [1.8.x] Fixed #24381 -- removed ForeignObjectRel opts and to_opts These cached properies were causing problems with pickling, and in addition they were confusingly defined: field.rel.model._meta was not the same as field.rel.opts. Instead users should use field.rel.related_model._meta inplace of field.rel.opts, and field.rel.to._meta in place of field.rel.to_opts. Backport of f95122e541df5bebb9b5ebb6226b0013e5edc893 from master --- tests/queryset_pickle/tests.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tests') diff --git a/tests/queryset_pickle/tests.py b/tests/queryset_pickle/tests.py index 0d9687bf16..d735413e1f 100644 --- a/tests/queryset_pickle/tests.py +++ b/tests/queryset_pickle/tests.py @@ -43,6 +43,9 @@ class PickleabilityTestCase(TestCase): def test_membermethod_as_default(self): self.assert_pickles(Happening.objects.filter(number4=1)) + def test_filter_reverse_fk(self): + self.assert_pickles(Group.objects.filter(event=1)) + def test_doesnotexist_exception(self): # Ticket #17776 original = Event.DoesNotExist("Doesn't exist") -- cgit v1.3