If the ``clean`` method on a required FileField receives False as the data, it has the same effect as None: initial is returned if non-empty, otherwise the validation catches the lack of a required value.
(self)
| 2502 | self.assertIs(f.clean(False, "initial"), False) |
| 2503 | |
| 2504 | def test_clean_false_required(self): |
| 2505 | """ |
| 2506 | If the ``clean`` method on a required FileField receives False as the |
| 2507 | data, it has the same effect as None: initial is returned if non-empty, |
| 2508 | otherwise the validation catches the lack of a required value. |
| 2509 | """ |
| 2510 | f = forms.FileField(required=True) |
| 2511 | self.assertEqual(f.clean(False, "initial"), "initial") |
| 2512 | with self.assertRaises(ValidationError): |
| 2513 | f.clean(False) |
| 2514 | |
| 2515 | def test_full_clear(self): |
| 2516 | """ |