mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #25548 -- Prevented FormView.form_invalid() from discarding its form argument.
This commit is contained in:
committed by
Simon Charette
parent
cc8c02fa0f
commit
e171a83b15
@@ -71,6 +71,13 @@ class BasicFormTests(TestCase):
|
||||
res = self.client.post('/contact/', {'name': "Me", 'message': "Hello"})
|
||||
self.assertRedirects(res, '/list/authors/')
|
||||
|
||||
def test_late_form_validation(self):
|
||||
"""
|
||||
A form can be marked invalid in the form_valid() method (#25548).
|
||||
"""
|
||||
res = self.client.post('/late-validation/', {'name': "Me", 'message': "Hello"})
|
||||
self.assertFalse(res.context['form'].is_valid())
|
||||
|
||||
|
||||
class ModelFormMixinTests(SimpleTestCase):
|
||||
def test_get_form(self):
|
||||
|
||||
Reference in New Issue
Block a user