mirror of
https://github.com/django/django.git
synced 2025-08-04 02:48:35 +00:00
Fixed #22539 -- Copied exclude argument in Model.full_clean() to prevent side effects.
This commit is contained in:
parent
45c2d1f5d9
commit
e2e4cdba11
3 changed files with 11 additions and 2 deletions
|
@ -3,9 +3,9 @@ from django.test import TestCase
|
|||
|
||||
|
||||
class ValidationTestCase(TestCase):
|
||||
def assertFailsValidation(self, clean, failed_fields):
|
||||
def assertFailsValidation(self, clean, failed_fields, **kwargs):
|
||||
with self.assertRaises(ValidationError) as cm:
|
||||
clean()
|
||||
clean(**kwargs)
|
||||
self.assertEqual(sorted(failed_fields), sorted(cm.exception.message_dict))
|
||||
|
||||
def assertFieldFailsValidationWithMessage(self, clean, field_name, message):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue