MCPcopy
hub / github.com/django/django / test_filefield_reopen

Method test_filefield_reopen

tests/file_storage/tests.py:821–829  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

819 obj.normal.close()
820
821 def test_filefield_reopen(self):
822 obj = Storage.objects.create(
823 normal=SimpleUploadedFile("reopen.txt", b"content")
824 )
825 with obj.normal as normal:
826 normal.open()
827 obj.normal.open()
828 obj.normal.file.seek(0)
829 obj.normal.close()
830
831 def test_duplicate_filename(self):
832 # Multiple files with the same name get _(7 random chars) appended to

Callers

nothing calls this directly

Calls 5

SimpleUploadedFileClass · 0.90
seekMethod · 0.80
createMethod · 0.45
openMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected