summaryrefslogtreecommitdiff
path: root/tests/validation/tests.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/validation/tests.py')
-rw-r--r--tests/validation/tests.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/validation/tests.py b/tests/validation/tests.py
index 7f81cafccf..6122444e3d 100644
--- a/tests/validation/tests.py
+++ b/tests/validation/tests.py
@@ -59,6 +59,13 @@ class BaseModelValidationTests(ValidationTestCase):
mtv = ModelToValidate(number=10, name='Some Name', slug='##invalid##')
self.assertFailsValidation(mtv.full_clean, ['slug'])
+ def test_full_clean_does_not_mutate_exclude(self):
+ mtv = ModelToValidate(f_with_custom_validator=42)
+ exclude = ['number']
+ self.assertFailsValidation(mtv.full_clean, ['name'], exclude=exclude)
+ self.assertEqual(len(exclude), 1)
+ self.assertEqual(exclude[0], 'number')
+
class ArticleForm(forms.ModelForm):
class Meta: