summaryrefslogtreecommitdiff
path: root/tests/model_forms
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2019-01-02 18:18:19 -0500
committerGitHub <noreply@github.com>2019-01-02 18:18:19 -0500
commit0004daa536890fdb389c895baaa21bea6a1f7073 (patch)
tree9f66a0ce81466d8fa7043e70f0d96b9cc3350473 /tests/model_forms
parent5bbf31634faad13658dc7bcaeb8139d8625e4349 (diff)
downloaddjango-0004daa536890fdb389c895baaa21bea6a1f7073.tar.gz
Used 4 space hanging indent for dictionaries.
Thanks Mariusz Felisiak for auditing.
Diffstat (limited to 'tests/model_forms')
-rw-r--r--tests/model_forms/tests.py28
1 files changed, 19 insertions, 9 deletions
diff --git a/tests/model_forms/tests.py b/tests/model_forms/tests.py
index 77075e52f9..f4f3169bc1 100644
--- a/tests/model_forms/tests.py
+++ b/tests/model_forms/tests.py
@@ -1297,9 +1297,11 @@ class ModelFormBasicTests(TestCase):
def test_basic_creation(self):
self.assertEqual(Category.objects.count(), 0)
- f = BaseCategoryForm({'name': 'Entertainment',
- 'slug': 'entertainment',
- 'url': 'entertainment'})
+ f = BaseCategoryForm({
+ 'name': 'Entertainment',
+ 'slug': 'entertainment',
+ 'url': 'entertainment',
+ })
self.assertTrue(f.is_valid())
self.assertEqual(f.cleaned_data['name'], 'Entertainment')
self.assertEqual(f.cleaned_data['slug'], 'entertainment')
@@ -1712,15 +1714,23 @@ class ModelMultipleChoiceFieldTests(TestCase):
person1 = Writer.objects.create(name="Person 1")
person2 = Writer.objects.create(name="Person 2")
- form = WriterForm(initial={'persons': [person1, person2]},
- data={'initial-persons': [str(person1.pk), str(person2.pk)],
- 'persons': [str(person1.pk), str(person2.pk)]})
+ form = WriterForm(
+ initial={'persons': [person1, person2]},
+ data={
+ 'initial-persons': [str(person1.pk), str(person2.pk)],
+ 'persons': [str(person1.pk), str(person2.pk)],
+ },
+ )
self.assertTrue(form.is_valid())
self.assertFalse(form.has_changed())
- form = WriterForm(initial={'persons': [person1, person2]},
- data={'initial-persons': [str(person1.pk), str(person2.pk)],
- 'persons': [str(person2.pk)]})
+ form = WriterForm(
+ initial={'persons': [person1, person2]},
+ data={
+ 'initial-persons': [str(person1.pk), str(person2.pk)],
+ 'persons': [str(person2.pk)],
+ },
+ )
self.assertTrue(form.is_valid())
self.assertTrue(form.has_changed())