If the ``clean`` method on a non-required FileField receives False as the data (meaning clear the field value), it returns False, regardless of the value of ``initial``.
(self)
| 2492 | self.addCleanup(shutil.rmtree, temp_storage_dir) |
| 2493 | |
| 2494 | def test_clean_false(self): |
| 2495 | """ |
| 2496 | If the ``clean`` method on a non-required FileField receives False as |
| 2497 | the data (meaning clear the field value), it returns False, regardless |
| 2498 | of the value of ``initial``. |
| 2499 | """ |
| 2500 | f = forms.FileField(required=False) |
| 2501 | self.assertIs(f.clean(False), False) |
| 2502 | self.assertIs(f.clean(False, "initial"), False) |
| 2503 | |
| 2504 | def test_clean_false_required(self): |
| 2505 | """ |