#34941: db_default with decimal.Decimal() doesn't return Decimal instances on
Oracle.
-------------------------------------+-------------------------------------
Reporter: Mariusz Felisiak | Owner: nobody
Type: Bug | Status: new
Component: Database layer | Version: 5.0
(models, ORM) |
Severity: Release blocker | Resolution:
Keywords: oracle db_default | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Description changed by Mariusz Felisiak:
Old description:
> While working on #34936 I noticed that `DecimalField` with `db_default`
> set to a `Decimal()` instance doesn't return `Decimal()` on Oracle:
>
> {{{
> /runtests.py field_defaults
> Testing against Django installed in '/django/django' with up to 8
> processes
> Found 16 test(s).
> Creating test database for alias 'default'...
> Creating test user...
> System check identified no issues (0 silenced).
> .....s..sF......
> ======================================================================
> FAIL: test_field_db_defaults_returning
> (field_defaults.tests.DefaultTests)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
> File "/django/django/test/testcases.py", line 1427, in skip_wrapper
> return test_func(*args, **kwargs)
> File "/django/tests/field_defaults/tests.py", line 48, in
> test_field_db_defaults_returning
> self.assertEqual(a.cost, Decimal("3.33"))
> AssertionError: 3.33 != Decimal('3.33')
>
> ----------------------------------------------------------------------
> Ran 16 tests in 0.089s
>
> FAILED (failures=1, skipped=2)
> Destroying test database for alias 'default'...
> Destroying test user...
> Destroying test database tables...
> }}}
>
> It works properly when using `bulk_create()`.
>
> Regression in 7414704e88d73dafbcfbb85f9bc54cb6111439d3.
New description:
While working on #34936 I noticed that `DecimalField` with `db_default`
set to a `Decimal()` instance doesn't return `Decimal()` on Oracle:
{{{
/runtests.py field_defaults
Testing against Django installed in '/django/django' with up to 8
processes
Found 16 test(s).
Creating test database for alias 'default'...
Creating test user...
System check identified no issues (0 silenced).
.....s..sF......
======================================================================
FAIL: test_field_db_defaults_returning (field_defaults.tests.DefaultTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/django/django/test/testcases.py", line 1427, in skip_wrapper
return test_func(*args, **kwargs)
File "/django/tests/field_defaults/tests.py", line 48, in
test_field_db_defaults_returning
self.assertEqual(a.cost, Decimal("3.33"))
AssertionError: 3.33 != Decimal('3.33')
----------------------------------------------------------------------
Ran 16 tests in 0.089s
FAILED (failures=1, skipped=2)
Destroying test database for alias 'default'...
Destroying test user...
Destroying test database tables...
}}}
~~It works properly when using `bulk_create()`.~~
Regression in 7414704e88d73dafbcfbb85f9bc54cb6111439d3.
--
--
Ticket URL: <https://code.djangoproject.com/ticket/34941#comment:5>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/0107018b938bb717-0f6d53a6-3afa-4bac-b364-59490a9232ce-000000%40eu-central-1.amazonses.com.