From d2f2a6a6d5cf40ec6dffdc9a195f71bedd72acb4 Mon Sep 17 00:00:00 2001 From: Adam Zapletal Date: Mon, 2 Dec 2024 21:10:43 -0600 Subject: [PATCH] Refs #21286 -- Enabled ImageField test cases in serializer data tests. This aligns ImageField to be tested in the same way as FileField. The commented-out test also exists for FileField and relates to #10244. --- tests/serializers/models/data.py | 4 ++-- tests/serializers/test_data.py | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/serializers/models/data.py b/tests/serializers/models/data.py index b82e8b4b33..0e08a9b125 100644 --- a/tests/serializers/models/data.py +++ b/tests/serializers/models/data.py @@ -62,8 +62,8 @@ class BigIntegerData(models.Model): data = models.BigIntegerField(null=True) -# class ImageData(models.Model): -# data = models.ImageField(null=True) +class ImageData(models.Model): + data = models.ImageField(null=True) class GenericIPAddressData(models.Model): diff --git a/tests/serializers/test_data.py b/tests/serializers/test_data.py index f8763f6e42..c0f5a38900 100644 --- a/tests/serializers/test_data.py +++ b/tests/serializers/test_data.py @@ -47,6 +47,7 @@ from .models import ( GenericData, GenericIPAddressData, GenericIPAddressPKData, + ImageData, InheritAbstractModel, InheritBaseModel, IntegerData, @@ -291,7 +292,9 @@ test_data = [ (data_obj, 81, IntegerData, -123456789), (data_obj, 82, IntegerData, 0), (data_obj, 83, IntegerData, None), - # (XX, ImageData + (data_obj, 86, ImageData, "file:///foo/bar/whiz.png"), + # (data_obj, 87, ImageData, None), + (data_obj, 88, ImageData, ""), (data_obj, 95, GenericIPAddressData, "fe80:1424:2223:6cff:fe8a:2e8a:2151:abcd"), (data_obj, 96, GenericIPAddressData, None), (data_obj, 110, PositiveBigIntegerData, 9223372036854775807),