From a5152bb64677fb9b976f6b35e80b11b368ef1e08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anssi=20K=C3=A4=C3=A4ri=C3=A4inen?= Date: Sat, 27 Oct 2012 18:10:02 +0300 Subject: [PATCH] Marked a test as expectedFailure on Oracle --- tests/regressiontests/introspection/tests.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/tests/regressiontests/introspection/tests.py b/tests/regressiontests/introspection/tests.py index a54e0c670b..4b8a3277e2 100644 --- a/tests/regressiontests/introspection/tests.py +++ b/tests/regressiontests/introspection/tests.py @@ -4,10 +4,15 @@ from functools import update_wrapper from django.db import connection from django.test import TestCase, skipUnlessDBFeature, skipIfDBFeature -from django.utils import six +from django.utils import six, unittest 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 # 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], ['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( [r[3] for r in desc if datatype(r[1], r) == 'CharField'], [30, 30, 75]