summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMatt Boersma <matt@sprout.org>2009-08-21 21:43:09 +0000
committerMatt Boersma <matt@sprout.org>2009-08-21 21:43:09 +0000
commit372736b70fbbad70bd66755c65f2919cdad2e8fd (patch)
tree97835f1891cae18a50112e1fbf55cd4cc3c3c906 /tests
parent0f70fd99fd7fa056a98a07c24c55399be7e04ba1 (diff)
[1.0.X] Fixed #11049: introspection on Oracle now identifies IntegerFields correctly.
git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@11476 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests')
-rw-r--r--tests/regressiontests/introspection/tests.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/regressiontests/introspection/tests.py b/tests/regressiontests/introspection/tests.py
index 7072dc8e9e..1454e1e3e5 100644
--- a/tests/regressiontests/introspection/tests.py
+++ b/tests/regressiontests/introspection/tests.py
@@ -76,7 +76,7 @@ class IntrospectionTests(TestCase):
def test_get_table_description_types(self):
cursor = connection.cursor()
desc = connection.introspection.get_table_description(cursor, Reporter._meta.db_table)
- self.assertEqual([datatype(r[1]) for r in desc],
+ self.assertEqual([datatype(r[1], r) for r in desc],
['IntegerField', 'CharField', 'CharField', 'CharField'])
# Regression test for #9991 - 'real' types in postgres
@@ -86,7 +86,7 @@ class IntrospectionTests(TestCase):
cursor.execute("CREATE TABLE django_ixn_real_test_table (number REAL);")
desc = connection.introspection.get_table_description(cursor, 'django_ixn_real_test_table')
cursor.execute('DROP TABLE django_ixn_real_test_table;')
- self.assertEqual(datatype(desc[0][1]), 'FloatField')
+ self.assertEqual(datatype(desc[0][1], desc[0]), 'FloatField')
def test_get_relations(self):
cursor = connection.cursor()
@@ -104,9 +104,10 @@ class IntrospectionTests(TestCase):
indexes = connection.introspection.get_indexes(cursor, Article._meta.db_table)
self.assertEqual(indexes['reporter_id'], {'unique': False, 'primary_key': False})
-def datatype(dbtype):
+
+def datatype(dbtype, description):
"""Helper to convert a data type into a string."""
- dt = connection.introspection.data_types_reverse[dbtype]
+ dt = connection.introspection.get_field_type(dbtype, description)
if type(dt) is tuple:
return dt[0]
else: