Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed #16645: fixed a broken test to work in Oracle.

git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 21a449168b6f9b0a4ec1589c0ebc5cf4ad6053cb 1 parent bf05da8
@ikelly ikelly authored
Showing with 8 additions and 1 deletion.
  1. +8 −1 tests/modeltests/model_forms/
9 tests/modeltests/model_forms/
@@ -8,6 +8,7 @@
from django.test import TestCase
from django.core.files.uploadedfile import SimpleUploadedFile
from django.core.validators import ValidationError
+from django.db import connection
from django.forms.models import model_to_dict
from django.utils.unittest import skipUnless
@@ -1313,11 +1314,17 @@ def test_image_field(self):
# Test the non-required ImageField
+ # Note: In Oracle, we expect a null ImageField to return u'' instead of
+ # None.
+ if connection.features.interprets_empty_strings_as_nulls:
+ expected_null_imagefield_repr = u''
+ else:
+ expected_null_imagefield_repr = None
f = OptionalImageFileForm(data={'description': u'Test'})
self.assertEqual(f.is_valid(), True)
instance =
- self.assertEqual(, None)
+ self.assertEqual(, expected_null_imagefield_repr)
self.assertEqual(instance.width, None)
self.assertEqual(instance.height, None)
Please sign in to comment.
Something went wrong with that request. Please try again.