From a40746b1cbc912119f9f873614017953b17a4d7a Mon Sep 17 00:00:00 2001 From: Baptiste Mispelon Date: Fri, 29 Mar 2013 13:32:21 +0100 Subject: [PATCH] Fix #20158: invalid code in queryset_pickle test models. --- tests/queryset_pickle/models.py | 6 +++--- tests/queryset_pickle/tests.py | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/queryset_pickle/models.py b/tests/queryset_pickle/models.py index d3500c903be..4bcfcfbf042 100644 --- a/tests/queryset_pickle/models.py +++ b/tests/queryset_pickle/models.py @@ -6,16 +6,16 @@ from django.db import models from django.utils.translation import ugettext_lazy as _ -def standalone_number(self): +def standalone_number(): return 1 class Numbers(object): @staticmethod - def get_static_number(self): + def get_static_number(): return 2 @classmethod - def get_class_number(self): + def get_class_number(cls): return 3 def get_member_number(self): diff --git a/tests/queryset_pickle/tests.py b/tests/queryset_pickle/tests.py index ab32e8f6479..da1bb8cb737 100644 --- a/tests/queryset_pickle/tests.py +++ b/tests/queryset_pickle/tests.py @@ -9,6 +9,9 @@ from .models import Group, Event, Happening class PickleabilityTestCase(TestCase): + def setUp(self): + Happening.objects.create() # make sure the defaults are working (#20158) + def assert_pickles(self, qs): self.assertEqual(list(pickle.loads(pickle.dumps(qs))), list(qs))