Description
I recently updated from 2.0.9 to 3.0.11 in my buildout and noticed some test failures. I was able to identify the problem: when running tests, the image scales cache does not work.
The reason is in the following lines:
plone.namedfile/plone/namedfile/scaling.py
Lines 387 to 393 in 7fc0e67
During tests, a content item may have the _p_mtime
attribute set to None
. So the code above is actually doing DateTime(None)
, which returns the current date/time. The result is every time a scale is requested it considers the cached value invalid, because the object is considered modified.
In the old version context.modified()
was used instead of _p_mtime
, and this method always returned a non-None value.
I wonder how to solve this problem. Maybe modified
should return a default date in the past?