Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#24197 closed Cleanup/optimization (fixed)

contrib.staticfiles does not respect override_settings

Reported by: Mark Lavin Owned by: Mark Lavin
Component: contrib.staticfiles Version: master
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Various parts of the staticfiles storages and finders do not respect changes to the related settings when using the override_settings or settings context manager in the test suite. This is handled in Django's own test suite by clearing the lru_cache and staticfiles_storage in the BaseStaticFilesTestCase.setUp. Ideally this would be handled by registering signal handlers for setting_changed as is done for DEFAULT_FILE_STORAGE, MEDIA_ROOT, etc for the uploaded media settings.

Change History (7)

comment:1 Changed 3 years ago by Mark Lavin

Summary: contrib.staticfiles does not resepect override_settingscontrib.staticfiles does not respect override_settings

comment:2 Changed 3 years ago by Tim Graham

Component: Testing frameworkcontrib.staticfiles
Triage Stage: UnreviewedAccepted
Type: UncategorizedCleanup/optimization
Version: 1.7master

comment:3 Changed 3 years ago by Mark Lavin

Owner: changed from nobody to Mark Lavin
Status: newassigned

comment:4 Changed 3 years ago by Mark Lavin

Has patch: set

comment:5 Changed 3 years ago by Tim Graham

Triage Stage: AcceptedReady for checkin

comment:6 Changed 3 years ago by Tim Graham <timograham@…>

Resolution: fixed
Status: assignedclosed

In 2730dad0d7c425f33f1ecc6cec01fdbf1cdd8376:

Fixed #24197 -- Added clearing of staticfiles caches on settings changes during tests

Cleared caching in staticfiles_storage and get_finder when
relevant settings are changed.

comment:7 Changed 3 years ago by Tim Graham <timograham@…>

In d585ade0dfef523c1c4be9fe6dad2dfaf3d1583d:

[1.8.x] Fixed #24197 -- Added clearing of staticfiles caches on settings changes during tests

Cleared caching in staticfiles_storage and get_finder when
relevant settings are changed.

Backport of 2730dad0d7c425f33f1ecc6cec01fdbf1cdd8376 from master

Note: See TracTickets for help on using tickets.
Back to Top