Opened 10 years ago

Closed 10 years ago

Last modified 10 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: dev
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 by Mark Lavin, 10 years ago

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

comment:2 by Tim Graham, 10 years ago

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

comment:3 by Mark Lavin, 10 years ago

Owner: changed from nobody to Mark Lavin
Status: newassigned

comment:4 by Mark Lavin, 10 years ago

Has patch: set

comment:5 by Tim Graham, 10 years ago

Triage Stage: AcceptedReady for checkin

comment:6 by Tim Graham <timograham@…>, 10 years ago

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 by Tim Graham <timograham@…>, 10 years ago

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