summaryrefslogtreecommitdiff
path: root/tests/queryset_pickle
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2021-12-04 15:55:03 +0100
committerGitHub <noreply@github.com>2021-12-04 15:55:03 +0100
commitd3a64bea51676fcf8a0ae593cf7b103939e12c87 (patch)
tree7ddd06d24af59d3169c754f0ed415a0bb151d8dd /tests/queryset_pickle
parentd3f4c2b95d2a13a5d9bc0e6413dfdbab21388822 (diff)
downloaddjango-d3a64bea51676fcf8a0ae593cf7b103939e12c87.tar.gz
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.
Diffstat (limited to 'tests/queryset_pickle')
-rw-r--r--tests/queryset_pickle/models.py3
-rw-r--r--tests/queryset_pickle/tests.py8
2 files changed, 8 insertions, 3 deletions
diff --git a/tests/queryset_pickle/models.py b/tests/queryset_pickle/models.py
index 9a033ffe95..f780dc2a18 100644
--- a/tests/queryset_pickle/models.py
+++ b/tests/queryset_pickle/models.py
@@ -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)
diff --git a/tests/queryset_pickle/tests.py b/tests/queryset_pickle/tests.py
index 60d30cd8ce..1d47f13c7d 100644
--- a/tests/queryset_pickle/tests.py
+++ b/tests/queryset_pickle/tests.py
@@ -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")