1
0
mirror of https://github.com/django/django.git synced 2025-10-24 22:26:08 +00:00

Refs #33476 -- Reformatted code with Black.

This commit is contained in:
django-bot
2022-02-03 20:24:19 +01:00
committed by Mariusz Felisiak
parent f68fa8b45d
commit 9c19aff7c7
1992 changed files with 139577 additions and 96284 deletions

View File

@@ -6,7 +6,6 @@ from .models import Post
class TextFieldTests(TestCase):
def test_max_length_passed_to_formfield(self):
"""
TextField passes its max_length attribute to form fields created using
@@ -19,21 +18,21 @@ class TextFieldTests(TestCase):
def test_choices_generates_select_widget(self):
"""A TextField with choices uses a Select widget."""
f = models.TextField(choices=[('A', 'A'), ('B', 'B')])
f = models.TextField(choices=[("A", "A"), ("B", "B")])
self.assertIsInstance(f.formfield().widget, forms.Select)
def test_to_python(self):
"""TextField.to_python() should return a string."""
f = models.TextField()
self.assertEqual(f.to_python(1), '1')
self.assertEqual(f.to_python(1), "1")
def test_lookup_integer_in_textfield(self):
self.assertEqual(Post.objects.filter(body=24).count(), 0)
def test_emoji(self):
p = Post.objects.create(title='Whatever', body='Smile 😀.')
p = Post.objects.create(title="Whatever", body="Smile 😀.")
p.refresh_from_db()
self.assertEqual(p.body, 'Smile 😀.')
self.assertEqual(p.body, "Smile 😀.")
class TestMethods(SimpleTestCase):
@@ -41,6 +40,6 @@ class TestMethods(SimpleTestCase):
field = models.TextField()
*_, kwargs = field.deconstruct()
self.assertEqual(kwargs, {})
field = models.TextField(db_collation='utf8_esperanto_ci')
field = models.TextField(db_collation="utf8_esperanto_ci")
*_, kwargs = field.deconstruct()
self.assertEqual(kwargs, {'db_collation': 'utf8_esperanto_ci'})
self.assertEqual(kwargs, {"db_collation": "utf8_esperanto_ci"})