1
0
mirror of https://github.com/django/django.git synced 2024-12-23 01:25:58 +00:00

Fix #20158: invalid code in queryset_pickle test models.

This commit is contained in:
Baptiste Mispelon 2013-03-29 13:32:21 +01:00
parent 738eef0f8b
commit a40746b1cb
2 changed files with 6 additions and 3 deletions

View File

@ -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):

View File

@ -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))