hovel / pybbm

Django forum solution. Tested, documented, shipped with example project.
BSD 2-Clause "Simplified" License
225 stars 151 forks source link

fix TIME_ZONE errors for datetime tests #264

Closed DylannCordel closed 7 years ago

DylannCordel commented 7 years ago

related to https://github.com/hovel/pybbm/pull/262#issuecomment-278853942

Now, django is aware of timezone when running tests and whatever the server TZ is, datetime operations are now correct :)

Thanks @lampslave for pointing this.

coveralls commented 7 years ago

Coverage Status

Changes Unknown when pulling 47ea8cf5538decfa5d3a9f07b28b94cfc0943587 on webu:fixes/tests into on hovel:master.

coveralls commented 7 years ago

Coverage Status

Changes Unknown when pulling 47ea8cf5538decfa5d3a9f07b28b94cfc0943587 on webu:fixes/tests into on hovel:master.

coveralls commented 7 years ago

Coverage Status

Changes Unknown when pulling 47ea8cf5538decfa5d3a9f07b28b94cfc0943587 on webu:fixes/tests into on hovel:master.

lampslave commented 7 years ago

I'm still not sure about time formatting, but maybe it's not so important since testing passed... Thanks for the quick fix :)

DylannCordel commented 7 years ago

You're welcome
In pybb_user_time, format is forced (eg: dateformat.format(context_time, 'd M, Y H:i')) and is not locale dependant as {{ datetime|date:DATE_FORMAT }} is. So we should no have any failure caused by user's localization which could differ from server's one.

lampslave commented 7 years ago

Yes, indeed, pybb_user_time use dateformat.format, but I think it was some kind of hardcode. Maybe in 2008 there was no localize. Never mind.