summaryrefslogtreecommitdiff
path: root/tests/model_formsets/tests.py
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2016-04-07 22:04:45 -0400
committerTim Graham <timograham@gmail.com>2016-04-08 10:12:33 -0400
commit92053acbb9160862c3e743a99ed8ccff8d4f8fd6 (patch)
tree50e7fd28a650f0e2352cf94f92e5a66d28a81988 /tests/model_formsets/tests.py
parentdf8d8d4292684d6ffa7474f1e201aed486f02b53 (diff)
Fixed E128 flake8 warnings in tests/.
Diffstat (limited to 'tests/model_formsets/tests.py')
-rw-r--r--tests/model_formsets/tests.py39
1 files changed, 23 insertions, 16 deletions
diff --git a/tests/model_formsets/tests.py b/tests/model_formsets/tests.py
index cb93b2fce3..4e909e5f5b 100644
--- a/tests/model_formsets/tests.py
+++ b/tests/model_formsets/tests.py
@@ -1506,8 +1506,7 @@ class ModelFormsetTest(TestCase):
}
formset = FormSet(data)
self.assertFalse(formset.is_valid())
- self.assertEqual(formset._non_form_errors,
- ['Please correct the duplicate data for slug.'])
+ self.assertEqual(formset._non_form_errors, ['Please correct the duplicate data for slug.'])
FormSet = modelformset_factory(Price, fields="__all__", extra=2)
data = {
@@ -1521,8 +1520,10 @@ class ModelFormsetTest(TestCase):
}
formset = FormSet(data)
self.assertFalse(formset.is_valid())
- self.assertEqual(formset._non_form_errors,
- ['Please correct the duplicate data for price and quantity, which must be unique.'])
+ self.assertEqual(
+ formset._non_form_errors,
+ ['Please correct the duplicate data for price and quantity, which must be unique.']
+ )
# Only the price field is specified, this should skip any unique checks since
# the unique_together is not fulfilled. This will fail with a KeyError if broken.
@@ -1559,10 +1560,8 @@ class ModelFormsetTest(TestCase):
}
formset = FormSet(data=data, instance=author)
self.assertFalse(formset.is_valid())
- self.assertEqual(formset._non_form_errors,
- ['Please correct the duplicate data for title.'])
- self.assertEqual(formset.errors,
- [{}, {'__all__': ['Please correct the duplicate values below.']}])
+ self.assertEqual(formset._non_form_errors, ['Please correct the duplicate data for title.'])
+ self.assertEqual(formset.errors, [{}, {'__all__': ['Please correct the duplicate values below.']}])
FormSet = modelformset_factory(Post, fields="__all__", extra=2)
data = {
@@ -1581,10 +1580,14 @@ class ModelFormsetTest(TestCase):
}
formset = FormSet(data)
self.assertFalse(formset.is_valid())
- self.assertEqual(formset._non_form_errors,
- ['Please correct the duplicate data for title which must be unique for the date in posted.'])
- self.assertEqual(formset.errors,
- [{}, {'__all__': ['Please correct the duplicate values below.']}])
+ self.assertEqual(
+ formset._non_form_errors,
+ ['Please correct the duplicate data for title which must be unique for the date in posted.']
+ )
+ self.assertEqual(
+ formset.errors,
+ [{}, {'__all__': ['Please correct the duplicate values below.']}]
+ )
data = {
'form-TOTAL_FORMS': '2',
@@ -1602,8 +1605,10 @@ class ModelFormsetTest(TestCase):
}
formset = FormSet(data)
self.assertFalse(formset.is_valid())
- self.assertEqual(formset._non_form_errors,
- ['Please correct the duplicate data for slug which must be unique for the year in posted.'])
+ self.assertEqual(
+ formset._non_form_errors,
+ ['Please correct the duplicate data for slug which must be unique for the year in posted.']
+ )
data = {
'form-TOTAL_FORMS': '2',
@@ -1621,8 +1626,10 @@ class ModelFormsetTest(TestCase):
}
formset = FormSet(data)
self.assertFalse(formset.is_valid())
- self.assertEqual(formset._non_form_errors,
- ['Please correct the duplicate data for subtitle which must be unique for the month in posted.'])
+ self.assertEqual(
+ formset._non_form_errors,
+ ['Please correct the duplicate data for subtitle which must be unique for the month in posted.']
+ )
class TestModelFormsetOverridesTroughFormMeta(TestCase):