mirror of
https://github.com/django/django.git
synced 2024-12-27 11:35:53 +00:00
ad5afd6ed2
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12866 bcc190cf-cafb-0310-a4f2-bffc1f526a37
15 lines
391 B
Python
15 lines
391 B
Python
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))
|