1
0
mirror of https://github.com/django/django.git synced 2025-10-23 21:59:11 +00:00

Fixed #31777 -- Added support for database collations to Char/TextFields.

Thanks Simon Charette and Mariusz Felisiak for reviews.
This commit is contained in:
Tom Carrick
2020-07-18 13:17:39 +02:00
committed by Mariusz Felisiak
parent ba6b32e5ef
commit e387f191f7
25 changed files with 544 additions and 30 deletions

View File

@@ -44,6 +44,16 @@ class TestCharField(TestCase):
self.assertEqual(p2.title, Event.C)
class TestMethods(SimpleTestCase):
def test_deconstruct(self):
field = models.CharField()
*_, kwargs = field.deconstruct()
self.assertEqual(kwargs, {})
field = models.CharField(db_collation='utf8_esperanto_ci')
*_, kwargs = field.deconstruct()
self.assertEqual(kwargs, {'db_collation': 'utf8_esperanto_ci'})
class ValidationTests(SimpleTestCase):
class Choices(models.TextChoices):