Opened 4 years ago

Closed 4 years ago

#31801 closed Bug (duplicate)

Oracle schema tests error out on Windows

Reported by: Ahmad A. Hussein Owned by: nobody
Component: Database layer (models, ORM) Version: dev
Severity: Normal Keywords: oracle, windows, schema
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Running the Django test suite on Windows with python3.8 gives the following errors in schema tests

ERROR: test_add_datefield_and_datetimefield_use_effective_default (schema.tests.SchemaTests)
effective_default() should be used for DateField, DateTimeField, and
----------------------------------------------------------------------
Traceback (most recent call last):
  File "c:\users\ahmad\appdata\local\programs\python\python38\lib\unittest\mock.py", line 1325, in patched
    return func(*newargs, **newkeywargs)
  File "C:\Users\ahmad\Desktop\Projects\DjangoGSOC\tests\schema\tests.py", line 2972, in test_add_datefield_and_datetimefield_use_effective_default
    columns = self.column_classes(Author)
  File "C:\Users\ahmad\Desktop\Projects\DjangoGSOC\tests\schema\tests.py", line 100, in column_classes
    columns = {
  File "C:\Users\ahmad\Desktop\Projects\DjangoGSOC\tests\schema\tests.py", line 101, in <dictcomp>
    d[0]: (connection.introspection.get_field_type(d[1], d), d)
  File "c:\users\ahmad\desktop\projects\djangogsoc\django\db\backends\oracle\introspection.py", line 51, in get_field_type
    return super().get_field_type(data_type, description)
  File "c:\users\ahmad\desktop\projects\djangogsoc\django\db\backends\base\introspection.py", line 25, in get_field_type
    return self.data_types_reverse[data_type]
KeyError: <cx_Oracle.DbType DB_TYPE_VARCHAR>

======================================================================
ERROR: test_add_field (schema.tests.SchemaTests)
Tests adding fields to models
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\ahmad\Desktop\Projects\DjangoGSOC\tests\schema\tests.py", line 488, in test_add_field
    columns = self.column_classes(Author)
  File "C:\Users\ahmad\Desktop\Projects\DjangoGSOC\tests\schema\tests.py", line 100, in column_classes
    columns = {
  File "C:\Users\ahmad\Desktop\Projects\DjangoGSOC\tests\schema\tests.py", line 101, in <dictcomp>
    d[0]: (connection.introspection.get_field_type(d[1], d), d)
  File "c:\users\ahmad\desktop\projects\djangogsoc\django\db\backends\oracle\introspection.py", line 51, in get_field_type
    return super().get_field_type(data_type, description)
  File "c:\users\ahmad\desktop\projects\djangogsoc\django\db\backends\base\introspection.py", line 25, in get_field_type
    return self.data_types_reverse[data_type]
KeyError: <cx_Oracle.DbType DB_TYPE_VARCHAR>

======================================================================
ERROR: test_add_field_binary (schema.tests.SchemaTests)
Tests binary fields get a sane default (#22851)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\ahmad\Desktop\Projects\DjangoGSOC\tests\schema\tests.py", line 612, in test_add_field_binary
    columns = self.column_classes(Author)
  File "C:\Users\ahmad\Desktop\Projects\DjangoGSOC\tests\schema\tests.py", line 100, in column_classes
    columns = {
  File "C:\Users\ahmad\Desktop\Projects\DjangoGSOC\tests\schema\tests.py", line 101, in <dictcomp>
    d[0]: (connection.introspection.get_field_type(d[1], d), d)
  File "c:\users\ahmad\desktop\projects\djangogsoc\django\db\backends\oracle\introspection.py", line 51, in get_field_type
    return super().get_field_type(data_type, description)
  File "c:\users\ahmad\desktop\projects\djangogsoc\django\db\backends\base\introspection.py", line 25, in get_field_type
    return self.data_types_reverse[data_type]
KeyError: <cx_Oracle.DbType DB_TYPE_VARCHAR>

======================================================================
ERROR: test_add_field_default_dropped (schema.tests.SchemaTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\ahmad\Desktop\Projects\DjangoGSOC\tests\schema\tests.py", line 2650, in test_add_field_default_dropped
    columns = self.column_classes(Author)
  File "C:\Users\ahmad\Desktop\Projects\DjangoGSOC\tests\schema\tests.py", line 100, in column_classes
    columns = {
  File "C:\Users\ahmad\Desktop\Projects\DjangoGSOC\tests\schema\tests.py", line 101, in <dictcomp>
    d[0]: (connection.introspection.get_field_type(d[1], d), d)
  File "c:\users\ahmad\desktop\projects\djangogsoc\django\db\backends\oracle\introspection.py", line 51, in get_field_type
    return super().get_field_type(data_type, description)
  File "c:\users\ahmad\desktop\projects\djangogsoc\django\db\backends\base\introspection.py", line 25, in get_field_type
    return self.data_types_reverse[data_type]
KeyError: <cx_Oracle.DbType DB_TYPE_VARCHAR>

======================================================================
ERROR: test_add_field_default_transform (schema.tests.SchemaTests)
Tests adding fields to models with a default that is not directly
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\ahmad\Desktop\Projects\DjangoGSOC\tests\schema\tests.py", line 593, in test_add_field_default_transform
    columns = self.column_classes(Author)
  File "C:\Users\ahmad\Desktop\Projects\DjangoGSOC\tests\schema\tests.py", line 100, in column_classes
    columns = {
  File "C:\Users\ahmad\Desktop\Projects\DjangoGSOC\tests\schema\tests.py", line 101, in <dictcomp>
    d[0]: (connection.introspection.get_field_type(d[1], d), d)
  File "c:\users\ahmad\desktop\projects\djangogsoc\django\db\backends\oracle\introspection.py", line 51, in get_field_type
    return super().get_field_type(data_type, description)
  File "c:\users\ahmad\desktop\projects\djangogsoc\django\db\backends\base\introspection.py", line 25, in get_field_type
    return self.data_types_reverse[data_type]
KeyError: <cx_Oracle.DbType DB_TYPE_VARCHAR>

======================================================================
ERROR: test_add_field_temp_default (schema.tests.SchemaTests)
Tests adding fields to models with a temporary default
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\ahmad\Desktop\Projects\DjangoGSOC\tests\schema\tests.py", line 523, in test_add_field_temp_default
    columns = self.column_classes(Author)
  File "C:\Users\ahmad\Desktop\Projects\DjangoGSOC\tests\schema\tests.py", line 100, in column_classes
    columns = {
  File "C:\Users\ahmad\Desktop\Projects\DjangoGSOC\tests\schema\tests.py", line 101, in <dictcomp>
    d[0]: (connection.introspection.get_field_type(d[1], d), d)
  File "c:\users\ahmad\desktop\projects\djangogsoc\django\db\backends\oracle\introspection.py", line 51, in get_field_type
    return super().get_field_type(data_type, description)
  File "c:\users\ahmad\desktop\projects\djangogsoc\django\db\backends\base\introspection.py", line 25, in get_field_type
    return self.data_types_reverse[data_type]
KeyError: <cx_Oracle.DbType DB_TYPE_VARCHAR>

======================================================================
ERROR: test_add_field_temp_default_boolean (schema.tests.SchemaTests)
Tests adding fields to models with a temporary default where
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\ahmad\Desktop\Projects\DjangoGSOC\tests\schema\tests.py", line 548, in test_add_field_temp_default_boolean
    columns = self.column_classes(Author)
  File "C:\Users\ahmad\Desktop\Projects\DjangoGSOC\tests\schema\tests.py", line 100, in column_classes
    columns = {
  File "C:\Users\ahmad\Desktop\Projects\DjangoGSOC\tests\schema\tests.py", line 101, in <dictcomp>
    d[0]: (connection.introspection.get_field_type(d[1], d), d)
  File "c:\users\ahmad\desktop\projects\djangogsoc\django\db\backends\oracle\introspection.py", line 51, in get_field_type
    return super().get_field_type(data_type, description)
  File "c:\users\ahmad\desktop\projects\djangogsoc\django\db\backends\base\introspection.py", line 25, in get_field_type
    return self.data_types_reverse[data_type]
KeyError: <cx_Oracle.DbType DB_TYPE_VARCHAR>

======================================================================
ERROR: test_add_field_use_effective_default (schema.tests.SchemaTests)
#23987 - effective_default() should be used as the field default when
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\ahmad\Desktop\Projects\DjangoGSOC\tests\schema\tests.py", line 2630, in test_add_field_use_effective_default
    columns = self.column_classes(Author)
  File "C:\Users\ahmad\Desktop\Projects\DjangoGSOC\tests\schema\tests.py", line 100, in column_classes
    columns = {
  File "C:\Users\ahmad\Desktop\Projects\DjangoGSOC\tests\schema\tests.py", line 101, in <dictcomp>
    d[0]: (connection.introspection.get_field_type(d[1], d), d)
  File "c:\users\ahmad\desktop\projects\djangogsoc\django\db\backends\oracle\introspection.py", line 51, in get_field_type
    return super().get_field_type(data_type, description)
  File "c:\users\ahmad\desktop\projects\djangogsoc\django\db\backends\base\introspection.py", line 25, in get_field_type
    return self.data_types_reverse[data_type]
KeyError: <cx_Oracle.DbType DB_TYPE_VARCHAR>

======================================================================
ERROR: test_alter (schema.tests.SchemaTests)
Tests simple altering of fields
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\ahmad\Desktop\Projects\DjangoGSOC\tests\schema\tests.py", line 642, in test_alter
    columns = self.column_classes(Author)
  File "C:\Users\ahmad\Desktop\Projects\DjangoGSOC\tests\schema\tests.py", line 100, in column_classes
    columns = {
  File "C:\Users\ahmad\Desktop\Projects\DjangoGSOC\tests\schema\tests.py", line 101, in <dictcomp>
    d[0]: (connection.introspection.get_field_type(d[1], d), d)
  File "c:\users\ahmad\desktop\projects\djangogsoc\django\db\backends\oracle\introspection.py", line 51, in get_field_type
    return super().get_field_type(data_type, description)
  File "c:\users\ahmad\desktop\projects\djangogsoc\django\db\backends\base\introspection.py", line 25, in get_field_type
    return self.data_types_reverse[data_type]
KeyError: <cx_Oracle.DbType DB_TYPE_VARCHAR>

======================================================================
ERROR: test_alter_null_to_not_null (schema.tests.SchemaTests)
#23609 - Tests handling of default values when altering from NULL to NOT NULL.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\ahmad\Desktop\Projects\DjangoGSOC\tests\schema\tests.py", line 858, in test_alter_null_to_not_null
    columns = self.column_classes(Author)
  File "C:\Users\ahmad\Desktop\Projects\DjangoGSOC\tests\schema\tests.py", line 100, in column_classes
    columns = {
  File "C:\Users\ahmad\Desktop\Projects\DjangoGSOC\tests\schema\tests.py", line 101, in <dictcomp>
    d[0]: (connection.introspection.get_field_type(d[1], d), d)
  File "c:\users\ahmad\desktop\projects\djangogsoc\django\db\backends\oracle\introspection.py", line 51, in get_field_type
    return super().get_field_type(data_type, description)
  File "c:\users\ahmad\desktop\projects\djangogsoc\django\db\backends\base\introspection.py", line 25, in get_field_type
    return self.data_types_reverse[data_type]
KeyError: <cx_Oracle.DbType DB_TYPE_VARCHAR>

======================================================================
ERROR: test_alter_text_field_to_date_field (schema.tests.SchemaTests)
#25002 - Test conversion of text field to date field.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\ahmad\Desktop\Projects\DjangoGSOC\tests\schema\tests.py", line 782, in test_alter_text_field_to_date_field
    columns = self.column_classes(Note)
  File "C:\Users\ahmad\Desktop\Projects\DjangoGSOC\tests\schema\tests.py", line 100, in column_classes
    columns = {
  File "C:\Users\ahmad\Desktop\Projects\DjangoGSOC\tests\schema\tests.py", line 101, in <dictcomp>
    d[0]: (connection.introspection.get_field_type(d[1], d), d)
  File "c:\users\ahmad\desktop\projects\djangogsoc\django\db\backends\oracle\introspection.py", line 51, in get_field_type
    return super().get_field_type(data_type, description)
  File "c:\users\ahmad\desktop\projects\djangogsoc\django\db\backends\base\introspection.py", line 25, in get_field_type
    return self.data_types_reverse[data_type]
KeyError: <cx_Oracle.DbType DB_TYPE_DATE>

======================================================================
ERROR: test_rename (schema.tests.SchemaTests)
Tests simple altering of fields
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\ahmad\Desktop\Projects\DjangoGSOC\tests\schema\tests.py", line 1440, in test_rename
    columns = self.column_classes(Author)
  File "C:\Users\ahmad\Desktop\Projects\DjangoGSOC\tests\schema\tests.py", line 100, in column_classes
    columns = {
  File "C:\Users\ahmad\Desktop\Projects\DjangoGSOC\tests\schema\tests.py", line 101, in <dictcomp>
    d[0]: (connection.introspection.get_field_type(d[1], d), d)
  File "c:\users\ahmad\desktop\projects\djangogsoc\django\db\backends\oracle\introspection.py", line 51, in get_field_type
    return super().get_field_type(data_type, description)
  File "c:\users\ahmad\desktop\projects\djangogsoc\django\db\backends\base\introspection.py", line 25, in get_field_type
    return self.data_types_reverse[data_type]
KeyError: <cx_Oracle.DbType DB_TYPE_VARCHAR>}}}

Change History (1)

comment:1 by Mariusz Felisiak, 4 years ago

Resolution: duplicate
Status: newclosed

These failures are related with cx_Oracle 8 and are already fixed.

Duplicate of #31751.

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