mirror of
https://github.com/django/django.git
synced 2025-11-24 21:00:12 +00:00
Fixed E128 flake8 warnings in tests/.
This commit is contained in:
parent
df8d8d4292
commit
92053acbb9
148 changed files with 2073 additions and 2248 deletions
|
|
@ -28,12 +28,15 @@ class BaseModelValidationTests(ValidationTestCase):
|
|||
|
||||
def test_wrong_FK_value_raises_error(self):
|
||||
mtv = ModelToValidate(number=10, name='Some Name', parent_id=3)
|
||||
self.assertFieldFailsValidationWithMessage(mtv.full_clean, 'parent',
|
||||
['model to validate instance with id %r does not exist.' % mtv.parent_id])
|
||||
|
||||
self.assertFieldFailsValidationWithMessage(
|
||||
mtv.full_clean, 'parent',
|
||||
['model to validate instance with id %r does not exist.' % mtv.parent_id]
|
||||
)
|
||||
mtv = ModelToValidate(number=10, name='Some Name', ufm_id='Some Name')
|
||||
self.assertFieldFailsValidationWithMessage(mtv.full_clean, 'ufm',
|
||||
["unique fields model instance with unique_charfield %r does not exist." % mtv.name])
|
||||
self.assertFieldFailsValidationWithMessage(
|
||||
mtv.full_clean, 'ufm',
|
||||
["unique fields model instance with unique_charfield %r does not exist." % mtv.name]
|
||||
)
|
||||
|
||||
def test_correct_FK_value_validates(self):
|
||||
parent = ModelToValidate.objects.create(number=10, name='Some Name')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue