1
0
mirror of https://github.com/django/django.git synced 2025-10-24 14:16:09 +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

@@ -817,23 +817,26 @@ class ModelStateTests(SimpleTestCase):
def test_bound_field_sanity_check(self):
field = models.CharField(max_length=1)
field.model = models.Model
with self.assertRaisesMessage(ValueError,
'ModelState.fields cannot be bound to a model - "field" is.'):
with self.assertRaisesMessage(ValueError, 'ModelState.fields cannot be bound to a model - "field" is.'):
ModelState('app', 'Model', [('field', field)])
def test_sanity_check_to(self):
field = models.ForeignKey(UnicodeModel, models.CASCADE)
with self.assertRaisesMessage(ValueError,
'ModelState.fields cannot refer to a model class - "field.to" does. '
'Use a string reference instead.'):
with self.assertRaisesMessage(
ValueError,
'ModelState.fields cannot refer to a model class - "field.to" does. '
'Use a string reference instead.'
):
ModelState('app', 'Model', [('field', field)])
def test_sanity_check_through(self):
field = models.ManyToManyField('UnicodeModel')
field.remote_field.through = UnicodeModel
with self.assertRaisesMessage(ValueError,
'ModelState.fields cannot refer to a model class - "field.through" does. '
'Use a string reference instead.'):
with self.assertRaisesMessage(
ValueError,
'ModelState.fields cannot refer to a model class - "field.through" does. '
'Use a string reference instead.'
):
ModelState('app', 'Model', [('field', field)])
def test_fields_immutability(self):