summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2015-01-10 15:42:31 +0100
committerClaude Paroz <claude@2xlibre.net>2015-01-10 15:42:31 +0100
commitffca9b49d4b887bd03e9e5e784a811954ac839b9 (patch)
tree0318c734b8f66bdd913cf6abdbc3e929ca7f8fdc
parentd7bc37d611b43d58be4b430faf0b9813bcde29c6 (diff)
Updated introspection test to use skipUnlessDBFeature
-rw-r--r--tests/introspection/tests.py11
1 files changed, 4 insertions, 7 deletions
diff --git a/tests/introspection/tests.py b/tests/introspection/tests.py
index 97081717ba..1d39eeacbc 100644
--- a/tests/introspection/tests.py
+++ b/tests/introspection/tests.py
@@ -110,17 +110,14 @@ class IntrospectionTests(TransactionTestCase):
cursor.execute('DROP TABLE django_ixn_real_test_table;')
self.assertEqual(datatype(desc[0][1], desc[0]), 'FloatField')
+ @skipUnlessDBFeature('can_introspect_foreign_keys')
def test_get_relations(self):
with connection.cursor() as cursor:
relations = connection.introspection.get_relations(cursor, Article._meta.db_table)
- # Older versions of MySQL don't have the chops to report on this stuff,
- # so just skip it if no relations come back. If they do, though, we
- # should test that the response is correct.
- if relations:
- # That's {field_index: (field_index_other_table, other_table)}
- self.assertEqual(relations, {3: (0, Reporter._meta.db_table),
- 4: (0, Article._meta.db_table)})
+ # That's {field_index: (field_index_other_table, other_table)}
+ self.assertEqual(relations, {3: (0, Reporter._meta.db_table),
+ 4: (0, Article._meta.db_table)})
@skipUnlessDBFeature('can_introspect_foreign_keys')
def test_get_key_columns(self):