django
django copied to clipboard
Fixed #23251 -- Uses a temporary folder for media upload when running tests
Made nature of media uploads in tests same as database.
If TEST_MEDIA_ROOT
is defined in the settings:
- Running the test suit will create a new folder using TEST_MEDIA_ROOT, if any file is uploaded.
- During teardown of the test environment, the folder is deleted.
- Using the --keep-media flag will prevent deletion of the test folder.
If TEST_MEDIA_ROOT
is not defined in the settings, then it will follow the default behaviour of using MEDIA_ROOT
as earlier (for maintaining reverse compatibility).
Hello @bhavya-tech! Thank you for your contribution 💪
As it's your first contribution be sure to check out the patch review checklist.
If you're fixing a ticket from Trac make sure to set the "Has patch" flag and include a link to this PR in the ticket!
If you have any design or process questions then you can ask in the Django forum.
Welcome aboard ⛵️!
@shaib Do you want to take a look?
Waiting on Fixed #26029 -- Added STORAGES setting PR to get merged to proceed.