#35141: CACHE_MIDDLEWARE_SECONDS can be set to a float but has to be an int
-----------------------------------------------+------------------------
Reporter: Alexander Lazarević | Owner: nobody
Type: Bug | Status: new
Component: Core (Cache system) | Version: dev
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-----------------------------------------------+------------------------
CACHE_MIDDLEWARE_SECONDS can be a float like 2.0 instead of 2 and will
also be set in the response header `Cache-Control` to `max-age: 2.0`
This showed up in a template testcase, where it is set to a float
{{{
@override_settings(
CACHE_MIDDLEWARE_SECONDS=2.0,
ROOT_URLCONF="template_tests.alternate_urls"
)
class CacheMiddlewareTest(SimpleTestCase):
}}}
It would be sufficient to change the `override_settings` to `2` to make
the test correct, but I propose to cast the
`settings.CACHE_MIDDLEWARE_SECONDS` value to int at the places it is used,
for the same reasons as in https://code.djangoproject.com/ticket/31982
--
Ticket URL: <https://code.djangoproject.com/ticket/35141>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/0107018d3eb41790-6648a5c1-68f5-4a77-a71b-274f422114a8-000000%40eu-central-1.amazonses.com.