1
0
mirror of https://github.com/django/django.git synced 2024-12-26 19:16:11 +00:00

[5.0.x] Fixed #34941 -- Fixed fetching decimal db_defaults for DecimalFields on Oracle.

This is a long standing bug in bc91f27a86
that began manifesting in 7414704e88.
Backport of 656192c2c9 from main
This commit is contained in:
Mariusz Felisiak 2023-11-03 16:28:04 +01:00
parent e2330ccd10
commit 1383dc75eb
2 changed files with 2 additions and 7 deletions

View File

@ -119,12 +119,6 @@ class DatabaseFeatures(BaseDatabaseFeatures):
"Oracle doesn't support comparing NCLOB to NUMBER.": {
"generic_relations_regress.tests.GenericRelationTests.test_textlink_filter",
},
"DecimalField.db_default doesn't return decimal.Decimal instances on Oracle "
"(#34941).": {
"field_defaults.tests.DefaultTests.test_field_db_defaults_returning",
"migrations.test_operations.OperationTests."
"test_alter_field_change_nullable_to_decimal_database_default_not_null",
},
}
django_test_expected_failures = {
# A bug in Django/oracledb with respect to string handling (#23843).

View File

@ -1,4 +1,5 @@
import datetime
import decimal
from .base import Database
@ -23,7 +24,7 @@ class InsertVar:
"FloatField": Database.NATIVE_FLOAT,
"DateTimeField": Database.TIMESTAMP,
"DateField": Database.Date,
"DecimalField": Database.NUMBER,
"DecimalField": decimal.Decimal,
}
def __init__(self, field):