mirror of https://github.com/django/django.git
Fix #20158: invalid code in queryset_pickle test models.
This commit is contained in:
parent
738eef0f8b
commit
a40746b1cb
|
@ -6,16 +6,16 @@ from django.db import models
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import ugettext_lazy as _
|
||||||
|
|
||||||
|
|
||||||
def standalone_number(self):
|
def standalone_number():
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
class Numbers(object):
|
class Numbers(object):
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_static_number(self):
|
def get_static_number():
|
||||||
return 2
|
return 2
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def get_class_number(self):
|
def get_class_number(cls):
|
||||||
return 3
|
return 3
|
||||||
|
|
||||||
def get_member_number(self):
|
def get_member_number(self):
|
||||||
|
|
|
@ -9,6 +9,9 @@ from .models import Group, Event, Happening
|
||||||
|
|
||||||
|
|
||||||
class PickleabilityTestCase(TestCase):
|
class PickleabilityTestCase(TestCase):
|
||||||
|
def setUp(self):
|
||||||
|
Happening.objects.create() # make sure the defaults are working (#20158)
|
||||||
|
|
||||||
def assert_pickles(self, qs):
|
def assert_pickles(self, qs):
|
||||||
self.assertEqual(list(pickle.loads(pickle.dumps(qs))), list(qs))
|
self.assertEqual(list(pickle.loads(pickle.dumps(qs))), list(qs))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue