summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Carrick <tom@carrick.eu>2020-09-18 12:12:27 +0200
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2020-09-18 12:15:46 +0200
commit278b6187d2a6711afb0b35dc5c3c09fe5be9adb3 (patch)
treed77b0df99d7db0f43c05da2b992f7038ad4808ab
parentf3901b5899d746dc5b754115d94ce9a045b4db0a (diff)
Refs #21181 -- Corrected DatabaseFeatures.test_collations for Swedish collation.
Previously, backends used different keys "swedish-ci" or "swedish_ci".
-rw-r--r--django/db/backends/base/features.py2
-rw-r--r--django/db/backends/mysql/features.py2
-rw-r--r--django/db/backends/postgresql/features.py2
-rw-r--r--tests/db_functions/comparison/test_collate.py2
4 files changed, 4 insertions, 4 deletions
diff --git a/django/db/backends/base/features.py b/django/db/backends/base/features.py
index e042260810..3aa0577866 100644
--- a/django/db/backends/base/features.py
+++ b/django/db/backends/base/features.py
@@ -306,7 +306,7 @@ class BaseDatabaseFeatures:
test_collations = {
'ci': None, # Case-insensitive.
'cs': None, # Case-sensitive.
- 'swedish-ci': None # Swedish case-insensitive.
+ 'swedish_ci': None # Swedish case-insensitive.
}
def __init__(self, connection):
diff --git a/django/db/backends/mysql/features.py b/django/db/backends/mysql/features.py
index b0bf4fd763..e97b3bfaa4 100644
--- a/django/db/backends/mysql/features.py
+++ b/django/db/backends/mysql/features.py
@@ -46,7 +46,7 @@ class DatabaseFeatures(BaseDatabaseFeatures):
order_by_nulls_first = True
test_collations = {
'ci': 'utf8_general_ci',
- 'swedish-ci': 'utf8_swedish_ci',
+ 'swedish_ci': 'utf8_swedish_ci',
}
@cached_property
diff --git a/django/db/backends/postgresql/features.py b/django/db/backends/postgresql/features.py
index 67ccd14690..9080e75a36 100644
--- a/django/db/backends/postgresql/features.py
+++ b/django/db/backends/postgresql/features.py
@@ -59,7 +59,7 @@ class DatabaseFeatures(BaseDatabaseFeatures):
has_json_operators = True
json_key_contains_list_matching_requires_list = True
test_collations = {
- 'swedish-ci': 'sv-x-icu',
+ 'swedish_ci': 'sv-x-icu',
}
@cached_property
diff --git a/tests/db_functions/comparison/test_collate.py b/tests/db_functions/comparison/test_collate.py
index 6507c904bc..b680ed9a05 100644
--- a/tests/db_functions/comparison/test_collate.py
+++ b/tests/db_functions/comparison/test_collate.py
@@ -31,7 +31,7 @@ class CollateTests(TestCase):
self.assertSequenceEqual(qs, [self.author2, self.author1])
def test_language_collation_order_by(self):
- collation = connection.features.test_collations.get('swedish-ci')
+ collation = connection.features.test_collations.get('swedish_ci')
if not collation:
self.skipTest('This backend does not support language collations.')
author3 = Author.objects.create(alias='O', name='Jones')