Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#11049 closed (fixed)

Oracle fails to return IntegerField in test_get_table_description_types

Reported by: mboersma Owned by: mboersma
Component: Database layer (models, ORM) Version: master
Severity: Keywords: Oracle oracle
Cc: ikelly Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: yes Patch needs improvement: no
Easy pickings: UI/UX:

Description

The Oracle backend raises an AssertionError when executing test_get_table_description_types in the test suite:

C:\projects\django-1.0.x\tests>runtests.py --settings=testsettings.oracle introspection
...

======================================================================
FAIL: test_get_table_description_types (regressiontests.introspection.tests.IntrospectionTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\projects\django-1.0.x\tests\regressiontests\introspection\tests.py", line 28, in _inner
    return func(*args, **kwargs)
  File "C:\projects\django-1.0.x\tests\regressiontests\introspection\tests.py", line 80, in test_get_table_description_types
    ['IntegerField', 'CharField', 'CharField', 'CharField'])
AssertionError: ['DecimalField', 'CharField', 'CharField', 'CharField'] != ['IntegerField', 'CharField', 'CharField', 'CharField']

Oracle doesn't have a distinct data type for integers as opposed to floating point numbers; they all come across as cx_Oracle.NUMERIC. Either we should use a different approach during introspection, or this test case should be changed so this isn't considered an error when run against Oracle.

This happens in both the 1.0.x maintenance branch and the pre-1.1 trunk as of revision [10723]. It hasn't caused real-world problems as far as I know, but I've entered it here as a bug so we don't lose track of it.

Attachments (1)

11049_fix.diff (4.9 KB) - added by mboersma 6 years ago.
A fix to allow Oracle to properly introspect IntegerFields, created against trunk [10748]

Download all attachments as: .zip

Change History (4)

Changed 6 years ago by mboersma

A fix to allow Oracle to properly introspect IntegerFields, created against trunk [10748]

comment:1 Changed 6 years ago by mboersma

  • Has patch set
  • Needs documentation unset
  • Needs tests set
  • Owner changed from nobody to mboersma
  • Patch needs improvement unset
  • Status changed from new to assigned
  • Triage Stage changed from Unreviewed to Accepted

comment:2 Changed 6 years ago by mboersma

  • Resolution set to fixed
  • Status changed from assigned to closed

(In [11475]) Fixed #11049: introspection on Oracle now identifies IntegerFields correctly.

comment:3 Changed 6 years ago by mboersma

(In [11476]) [1.0.X] Fixed #11049: introspection on Oracle now identifies IntegerFields correctly.

Note: See TracTickets for help on using tickets.
Back to Top