(self)
| 807 | obj.normal.close() |
| 808 | |
| 809 | def test_filefield_write(self): |
| 810 | # Files can be written to. |
| 811 | obj = Storage.objects.create( |
| 812 | normal=SimpleUploadedFile("rewritten.txt", b"content") |
| 813 | ) |
| 814 | with obj.normal as normal: |
| 815 | normal.open("wb") |
| 816 | normal.write(b"updated") |
| 817 | obj.refresh_from_db() |
| 818 | self.assertEqual(obj.normal.read(), b"updated") |
| 819 | obj.normal.close() |
| 820 | |
| 821 | def test_filefield_reopen(self): |
| 822 | obj = Storage.objects.create( |
nothing calls this directly
no test coverage detected