summaryrefslogtreecommitdiff
path: root/tests/schema
diff options
context:
space:
mode:
authorAhmad A. Hussein <ahmadahussein0@gmail.com>2020-08-14 22:07:37 +0200
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2020-08-17 09:31:16 +0200
commit493b26bbfc9cc0ad223ece131741cba2312ced0f (patch)
tree0a3ac47beb49583e13a904983e90cd1c31c337d2 /tests/schema
parent632ccffc49658de5348c51a8918719364be54f37 (diff)
Fixed #31888 -- Avoided module-level MySQL queries in tests.
Diffstat (limited to 'tests/schema')
-rw-r--r--tests/schema/tests.py26
1 files changed, 13 insertions, 13 deletions
diff --git a/tests/schema/tests.py b/tests/schema/tests.py
index 8e3b76d043..d31a12e504 100644
--- a/tests/schema/tests.py
+++ b/tests/schema/tests.py
@@ -2,7 +2,7 @@ import datetime
import itertools
import unittest
from copy import copy
-from unittest import mock, skipIf
+from unittest import mock
from django.core.management.color import no_style
from django.db import (
@@ -710,13 +710,13 @@ class SchemaTests(TransactionTestCase):
editor.alter_field(Foo, old_field, new_field, strict=True)
Foo.objects.create()
- @skipIf(
- connection.vendor == 'mysql' and
- connection.mysql_is_mariadb and
- (10, 4, 3) < connection.mysql_version < (10, 5, 2),
- 'https://jira.mariadb.org/browse/MDEV-19598',
- )
def test_alter_not_unique_field_to_primary_key(self):
+ if (
+ connection.vendor == 'mysql' and
+ connection.mysql_is_mariadb and
+ (10, 4, 3) < connection.mysql_version < (10, 5, 2)
+ ):
+ self.skipTest('https://jira.mariadb.org/browse/MDEV-19598')
# Create the table.
with connection.schema_editor() as editor:
editor.create_model(Author)
@@ -2950,17 +2950,17 @@ class SchemaTests(TransactionTestCase):
editor.alter_field(Author, new_field, old_field, strict=True)
self.assertEqual(self.get_constraints_for_column(Author, 'weight'), [])
- @skipIf(
- connection.vendor == 'mysql' and
- connection.mysql_is_mariadb and
- (10, 4, 12) < connection.mysql_version < (10, 5),
- 'https://jira.mariadb.org/browse/MDEV-22775',
- )
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_is_mariadb and
+ (10, 4, 12) < connection.mysql_version < (10, 5)
+ ):
+ self.skipTest('https://jira.mariadb.org/browse/MDEV-22775')
with connection.schema_editor() as editor:
editor.create_model(Node)
old_field = Node._meta.get_field('node_id')