summaryrefslogtreecommitdiff
path: root/django/db/backends/mysql/features.py
diff options
context:
space:
mode:
authorHasan Ramezani <hasan.r67@gmail.com>2020-12-10 18:00:57 +0100
committerGitHub <noreply@github.com>2020-12-10 18:00:57 +0100
commit275dd4ebbabbbe758c7219a3d666953d5a7b072f (patch)
treed0534f7047f9ba43525368eda2c121df54801d4c /django/db/backends/mysql/features.py
parent5ce31d6a7142ca8c76d6b52fa42b3406b9a8ff48 (diff)
downloaddjango-275dd4ebbabbbe758c7219a3d666953d5a7b072f.tar.gz
Fixed #32178 -- Allowed database backends to skip tests and mark expected failures.
Co-authored-by: Tim Graham <timograham@gmail.com>
Diffstat (limited to 'django/db/backends/mysql/features.py')
-rw-r--r--django/db/backends/mysql/features.py46
1 files changed, 46 insertions, 0 deletions
diff --git a/django/db/backends/mysql/features.py b/django/db/backends/mysql/features.py
index 3713df549b..72fff72648 100644
--- a/django/db/backends/mysql/features.py
+++ b/django/db/backends/mysql/features.py
@@ -51,6 +51,52 @@ class DatabaseFeatures(BaseDatabaseFeatures):
}
@cached_property
+ def django_test_skips(self):
+ skips = {
+ "This doesn't work on MySQL.": {
+ 'db_functions.comparison.test_greatest.GreatestTests.test_coalesce_workaround',
+ 'db_functions.comparison.test_least.LeastTests.test_coalesce_workaround',
+ },
+ 'Running on MySQL requires utf8mb4 encoding (#18392).': {
+ 'model_fields.test_textfield.TextFieldTests.test_emoji',
+ 'model_fields.test_charfield.TestCharField.test_emoji',
+ },
+ }
+ if 'ONLY_FULL_GROUP_BY' in self.connection.sql_mode:
+ skips.update({
+ 'GROUP BY optimization does not work properly when '
+ 'ONLY_FULL_GROUP_BY mode is enabled on MySQL, see #31331.': {
+ 'aggregation.tests.AggregateTestCase.test_aggregation_subquery_annotation_multivalued',
+ 'annotations.tests.NonAggregateAnnotationTestCase.test_annotation_aggregate_with_m2o',
+ },
+ })
+ if (
+ self.connection.mysql_is_mariadb and
+ (10, 4, 3) < self.connection.mysql_version < (10, 5, 2)
+ ):
+ skips.update({
+ 'https://jira.mariadb.org/browse/MDEV-19598': {
+ 'schema.tests.SchemaTests.test_alter_not_unique_field_to_primary_key',
+ },
+ })
+ if (
+ self.connection.mysql_is_mariadb and
+ (10, 4, 12) < self.connection.mysql_version < (10, 5)
+ ):
+ skips.update({
+ 'https://jira.mariadb.org/browse/MDEV-22775': {
+ 'schema.tests.SchemaTests.test_alter_pk_with_self_referential_field',
+ },
+ })
+ if not self.supports_explain_analyze:
+ skips.update({
+ 'MariaDB and MySQL >= 8.0.18 specific.': {
+ 'queries.test_explain.ExplainTests.test_mysql_analyze',
+ },
+ })
+ return skips
+
+ @cached_property
def _mysql_storage_engine(self):
"Internal method used in Django tests. Don't rely on this from your code"
return self.connection.mysql_server_data['default_storage_engine']