summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Petrucha <michal.petrucha@koniiiik.org>2016-04-02 14:17:35 +0200
committerTim Graham <timograham@gmail.com>2016-04-02 08:17:35 -0400
commitd81d02d449edd046a94de5f171f4ae87fa331c7d (patch)
tree5bb30e3e60d978b10f7b405e538c0cde8c11b7cb
parent7d485d5d75bd9faab0b949fd34d4f098f8079452 (diff)
Refs #26384, #24995 -- Avoided a module-level MySQL query in the schema tests.
-rw-r--r--tests/schema/tests.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/tests/schema/tests.py b/tests/schema/tests.py
index 60b05854d0..4b715ad5bb 100644
--- a/tests/schema/tests.py
+++ b/tests/schema/tests.py
@@ -1820,15 +1820,13 @@ class SchemaTests(TransactionTestCase):
['schema_tag_slug_2c418ba3_like', 'schema_tag_slug_key']
)
- @unittest.skipIf(
- connection.vendor == 'mysql' and connection.mysql_version < (5, 6, 6),
- 'Skip known bug renaming primary keys on older MySQL versions (#24995).'
- )
def test_alter_pk_with_self_referential_field(self):
"""
Changing the primary key field name of a model with a self-referential
foreign key (#26384).
"""
+ if connection.vendor == 'mysql' and connection.mysql_version < (5, 6, 6):
+ self.skipTest('Skip known bug renaming primary keys on older MySQL versions (#24995).')
old_field = Node._meta.get_field('node_id')
new_field = AutoField(primary_key=True)
new_field.set_attributes_from_name('id')