mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
Fixed #33333 -- Fixed setUpTestData() crash with models.BinaryField on PostgreSQL.
This makes models.BinaryField pickleable on PostgreSQL.
Regression in 3cf80d3fcf.
Thanks Adam Zimmerman for the report.
This commit is contained in:
@@ -16,6 +16,10 @@ class PickleabilityTestCase(TestCase):
|
||||
def assert_pickles(self, qs):
|
||||
self.assertEqual(list(pickle.loads(pickle.dumps(qs))), list(qs))
|
||||
|
||||
def test_binaryfield(self):
|
||||
Happening.objects.create(data=b'binary data')
|
||||
self.assert_pickles(Happening.objects.all())
|
||||
|
||||
def test_related_field(self):
|
||||
g = Group.objects.create(name="Ponies Who Own Maybachs")
|
||||
self.assert_pickles(Event.objects.filter(group=g.id))
|
||||
|
||||
Reference in New Issue
Block a user