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

Fixed E128 flake8 warnings in tests/.

This commit is contained in:
Tim Graham
2016-04-07 22:04:45 -04:00
parent df8d8d4292
commit 92053acbb9
148 changed files with 2073 additions and 2248 deletions

View File

@@ -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):