mirror of
https://github.com/django/django.git
synced 2025-08-30 23:37:50 +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:
parent
ba6b32e5ef
commit
e387f191f7
25 changed files with 544 additions and 30 deletions
|
@ -2,7 +2,7 @@ from unittest import skipIf
|
|||
|
||||
from django import forms
|
||||
from django.db import connection, models
|
||||
from django.test import TestCase
|
||||
from django.test import SimpleTestCase, TestCase
|
||||
|
||||
from .models import Post
|
||||
|
||||
|
@ -37,3 +37,13 @@ class TextFieldTests(TestCase):
|
|||
p = Post.objects.create(title='Whatever', body='Smile 😀.')
|
||||
p.refresh_from_db()
|
||||
self.assertEqual(p.body, 'Smile 😀.')
|
||||
|
||||
|
||||
class TestMethods(SimpleTestCase):
|
||||
def test_deconstruct(self):
|
||||
field = models.TextField()
|
||||
*_, kwargs = field.deconstruct()
|
||||
self.assertEqual(kwargs, {})
|
||||
field = models.TextField(db_collation='utf8_esperanto_ci')
|
||||
*_, kwargs = field.deconstruct()
|
||||
self.assertEqual(kwargs, {'db_collation': 'utf8_esperanto_ci'})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue