Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed schema test for Oracle 11.2.0.1 which is used in Django Project…

…'s CI.

Refs #23073 Workaround.

Refs #22738 Repeats the mysql "offense". When the issue is solved, the
Oracle special case should be made to play with the solution (that is,
Oracle should be fixed the same way that mysql and the 3rd-party backneds
are).
  • Loading branch information...
commit 56252e7f46afce36fd112971c28188a3fd509a43 1 parent b902be7
@shaib shaib authored
Showing with 13 additions and 3 deletions.
  1. +10 −3 django/db/backends/oracle/base.py
  2. +3 −0  tests/schema/tests.py
View
13 django/db/backends/oracle/base.py
@@ -704,14 +704,21 @@ def is_usable(self):
return True
@cached_property
- def oracle_version(self):
+ def oracle_full_version(self):
with self.temporary_connection():
- version = self.connection.version
+ return self.connection.version
+
+ @cached_property
+ def oracle_version(self):
try:
- return int(version.split('.')[0])
+ return int(self.oracle_full_version.split('.')[0])
except ValueError:
return None
+ @cached_property
+ def version_has_default_introspection_bug(self):
+ return self.oracle_full_version < '11.2.0.2'
+
class OracleParam(object):
"""
View
3  tests/schema/tests.py
@@ -318,6 +318,9 @@ def test_add_field_temp_default_boolean(self):
if connection.vendor == 'mysql':
self.assertEqual(field_type, 'IntegerField')
self.assertEqual(field_info.precision, 1)
+ elif connection.vendor == 'oracle' and connection.version_has_default_introspection_bug:
+ self.assertEqual(field_type, 'IntegerField')
+ self.assertEqual(field_info.precision, 0)
else:
self.assertEqual(field_type, 'BooleanField')
Please sign in to comment.
Something went wrong with that request. Please try again.