(self)
| 888 | ) |
| 889 | |
| 890 | def test_not_a_directory(self): |
| 891 | default_storage.delete(UPLOAD_TO) |
| 892 | # Create a file with the upload directory name |
| 893 | with SimpleUploadedFile(UPLOAD_TO, b"x") as file: |
| 894 | default_storage.save(UPLOAD_FOLDER, file) |
| 895 | self.addCleanup(default_storage.delete, UPLOAD_TO) |
| 896 | msg = "%s exists and is not a directory." % UPLOAD_TO |
| 897 | with self.assertRaisesMessage(FileExistsError, msg): |
| 898 | with SimpleUploadedFile("foo.txt", b"x") as file: |
| 899 | self.obj.testfile.save("foo.txt", file, save=False) |
| 900 | |
| 901 | |
| 902 | class MultiParserTests(SimpleTestCase): |
nothing calls this directly
no test coverage detected