1
0
mirror of https://github.com/django/django.git synced 2025-05-07 15:36:29 +00:00

Marked a test as expectedFailure on Oracle

This commit is contained in:
Anssi Kääriäinen 2012-10-27 18:10:02 +03:00
parent c159d9cec0
commit a5152bb646

View File

@ -4,10 +4,15 @@ from functools import update_wrapper
from django.db import connection from django.db import connection
from django.test import TestCase, skipUnlessDBFeature, skipIfDBFeature from django.test import TestCase, skipUnlessDBFeature, skipIfDBFeature
from django.utils import six from django.utils import six, unittest
from .models import Reporter, Article from .models import Reporter, Article
if connection.vendor == 'oracle':
expectedFailureOnOracle = unittest.expectedFailure
else:
expectedFailureOnOracle = lambda f: f
# #
# The introspection module is optional, so methods tested here might raise # The introspection module is optional, so methods tested here might raise
# NotImplementedError. This is perfectly acceptable behavior for the backend # NotImplementedError. This is perfectly acceptable behavior for the backend
@ -89,7 +94,13 @@ class IntrospectionTests(six.with_metaclass(IgnoreNotimplementedError, TestCase)
[datatype(r[1], r) for r in desc], [datatype(r[1], r) for r in desc],
['IntegerField', 'CharField', 'CharField', 'CharField', 'BigIntegerField'] ['IntegerField', 'CharField', 'CharField', 'CharField', 'BigIntegerField']
) )
# Check also length of CharFields
# The following test fails on Oracle due to #17202 (can't correctly
# inspect the length of character columns).
@expectedFailureOnOracle
def test_get_table_description_col_lengths(self):
cursor = connection.cursor()
desc = connection.introspection.get_table_description(cursor, Reporter._meta.db_table)
self.assertEqual( self.assertEqual(
[r[3] for r in desc if datatype(r[1], r) == 'CharField'], [r[3] for r in desc if datatype(r[1], r) == 'CharField'],
[30, 30, 75] [30, 30, 75]