feincms / feincms-elephantblog

A blog for FeinCMS
feinheit.ch/labs/
BSD 3-Clause "New" or "Revised" License
43 stars 38 forks source link

Tests for last hotfix #43

Closed sbaechler closed 9 years ago

sbaechler commented 9 years ago

The fix in https://github.com/feincms/feincms-elephantblog/commit/1823c14ae1cca21a9f3a49badb377d38259cf76c needs unit tests.

matthiask commented 9 years ago

Yes. Btw, elephantblog_archive_months is already being tested, and both codepaths are run by Travis CI. We did not see the problem earlier because USE_TZ is set to False in the testsuite.

matthiask commented 9 years ago

.dates() returns naive datetimes, which in turn makes |date handle those dates incorrectly. The naive datetimes were seen as UTC, while the installation's time zone was America/Chicago. This also explains why we always got the previous month (because america's wall clock is behind UTC).

The test suite now tests what it is supposed to:

https://github.com/feincms/feincms-elephantblog/blob/5d0c90a5353e02a6790859f36f28d107138cc6e1/tests/testapp/tests/test_templatetags.py

sbaechler commented 9 years ago

Achso, danke.