cx_Oracle.UNICODE missing if cx_Oracle version 5.0.1 is compiled without Unicode support
Oracle test failed with:
======================================================================
ERROR: test_get_table_description_types (regressiontests.introspection.tests.IntrospectionTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/jirka/dev/django/tests/regressiontests/introspection/tests.py", line 28, in _inner
return func(*args, **kwargs)
File "/home/jirka/dev/django/tests/regressiontests/introspection/tests.py", line 79, in test_get_table_description_types
self.assertEqual([datatype(r[1]) for r in desc],
File "/home/jirka/dev/django/tests/regressiontests/introspection/tests.py", line 109, in datatype
dt = connection.introspection.data_types_reverse[dbtype]
KeyError: <type 'cx_Oracle.UNICODE'>
Patch is based on email from Ian Kelly:
test_get_table_description_types: This only occurs if you're running cx_Oracle 5.0.1 without the WITH_UNICODE compilation flag. To fix it, we just need to add cx_Oracle.UNICODE to the data_types_reverse dict, mapping it to CharField. cx_Oracle.UNICODE isn't defined in all versions of cx_Oracle, so there needs to be a check that it actually exists before referencing it.
(In [10749]) Fixed #11033 -- handle cx_Oracle.UNICODE when driver was compiled without Unicode support. Thanks, JirkaV.