mirror of
https://github.com/django/django.git
synced 2024-12-22 17:16:24 +00:00
Refs #33333 -- Fixed PickleabilityTestCase.test_annotation_with_callable_default() crash on Oracle.
Grouping by LOBs is not allowed on Oracle. This moves a binary field to a separate model.
This commit is contained in:
parent
d3f4c2b95d
commit
d3a64bea51
@ -46,6 +46,9 @@ class Happening(models.Model):
|
||||
number1 = models.IntegerField(blank=True, default=standalone_number)
|
||||
number2 = models.IntegerField(blank=True, default=Numbers.get_static_number)
|
||||
event = models.OneToOneField(Event, models.CASCADE, null=True)
|
||||
|
||||
|
||||
class BinaryFieldModel(models.Model):
|
||||
data = models.BinaryField(null=True)
|
||||
|
||||
|
||||
|
@ -5,7 +5,9 @@ import django
|
||||
from django.db import models
|
||||
from django.test import TestCase
|
||||
|
||||
from .models import Container, Event, Group, Happening, M2MModel, MyEvent
|
||||
from .models import (
|
||||
BinaryFieldModel, Container, Event, Group, Happening, M2MModel, MyEvent,
|
||||
)
|
||||
|
||||
|
||||
class PickleabilityTestCase(TestCase):
|
||||
@ -17,8 +19,8 @@ class PickleabilityTestCase(TestCase):
|
||||
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())
|
||||
BinaryFieldModel.objects.create(data=b'binary data')
|
||||
self.assert_pickles(BinaryFieldModel.objects.all())
|
||||
|
||||
def test_related_field(self):
|
||||
g = Group.objects.create(name="Ponies Who Own Maybachs")
|
||||
|
Loading…
Reference in New Issue
Block a user