Opened 8 years ago

Closed 7 years ago

Last modified 7 years ago

#11049 closed (fixed)

Oracle fails to return IntegerField in test_get_table_description_types

Reported by: Matt Boersma Owned by: Matt Boersma
Component: Database layer (models, ORM) Version: master
Severity: Keywords: Oracle oracle
Cc: Ian Kelly 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 Matt Boersma 8 years ago.
A fix to allow Oracle to properly introspect IntegerFields, created against trunk [10748]

Download all attachments as: .zip

Change History (4)

Changed 8 years ago by Matt Boersma

Attachment: 11049_fix.diff added

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

comment:1 Changed 8 years ago by Matt Boersma

Has patch: set
Needs tests: set
Owner: changed from nobody to Matt Boersma
Status: newassigned
Triage Stage: UnreviewedAccepted

comment:2 Changed 7 years ago by Matt Boersma

Resolution: fixed
Status: assignedclosed

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

comment:3 Changed 7 years ago by Matt Boersma

(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