Fixed #34110 -- Added in-memory file storage.

Thanks Paolo Melchiorre, Carlton Gibson, and Mariusz Felisiak for
reviews.
This commit is contained in:
Francesco Panico 2022-11-11 07:17:49 +01:00 committed by Mariusz Felisiak
parent 04fdf71933
commit 72efd840a8
7 changed files with 638 additions and 2 deletions

View file

@ -366,3 +366,12 @@ Preserving the test database
The :option:`test --keepdb` option preserves the test database between test
runs. It skips the create and destroy actions which can greatly decrease the
time to run tests.
Avoiding disk access for media files
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. versionadded:: 4.2
The :class:`~django.core.files.storage.InMemoryStorage` is a convenient way to
prevent disk access for media files. All data is kept in memory, then it gets
discarded after tests run.