diff options
author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2020-07-22 10:57:38 +0200 |
---|---|---|
committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2020-07-22 10:58:47 +0200 |
commit | 1a81d34e70bdffbb563e053c3178ab885436c00c (patch) | |
tree | 93a53f1c2f60e4462862535a1171650442cdf04b /tests | |
parent | 0a3c1272f2213ccd2b36081c8d587b3f33237a5d (diff) | |
download | django-1a81d34e70bdffbb563e053c3178ab885436c00c.tar.gz |
[3.0.x] Fixed #31797 -- Skipped schema tests on specific MariaDB versions.
test_alter_not_unique_field_to_primary_key() test is affected by
https://jira.mariadb.org/browse/MDEV-19598 on MariaDB 10.4.4 to 10.5.1.
test_alter_pk_with_self_referential_field() test is affected by
https://jira.mariadb.org/browse/MDEV-22775 on MariaDB 10.4 series
from 10.4.13.
Backport of c071c408d72330b422c124a6bdd85a68acae9566 from master
Diffstat (limited to 'tests')
-rw-r--r-- | tests/schema/tests.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/tests/schema/tests.py b/tests/schema/tests.py index ad66f55650..d8680501bc 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 +from unittest import mock, skipIf from django.core.management.color import no_style from django.db import ( @@ -694,6 +694,12 @@ 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): # Create the table. with connection.schema_editor() as editor: @@ -2879,6 +2885,12 @@ 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 |