Browse Source

Fix test error about rounding

pull/307/head
Florian Mounier 9 years ago
parent
commit
40bf2ad7fe
  1. 3
      demo/moulinrouge/tests.py
  2. 1
      docs/changelog.rst
  3. 3
      pygal/test/test_date.py

3
demo/moulinrouge/tests.py

@ -946,8 +946,9 @@ def get_test_routes(app):
(tz.localize(datetime(2013, 1, 12, 14)), 30),
(tz.localize(datetime(2013, 1, 12, 16)), 200)
])
from datetime import timezone
line.x_value_formatter = lambda x: (
x.replace(tzinfo=pytz.utc).astimezone(tz)).isoformat()
x.replace(tzinfo=timezone.utc).astimezone(tz)).isoformat()
# line.x_value_formatter = lambda x: tz.normalize(
# x.replace(tzinfo=pytz.utc)).isoformat()
line.x_label_rotation = 45

1
docs/changelog.rst

@ -12,6 +12,7 @@ Changelog
* The `human_readable` option has been removed. Now you have to use the pygal.formatters.human_readable formatter (value_formatter=human_readable instead of human_readable=True)
* New chart type: SolidGauge (thanks @chartique #295)
* Fix range option for some Charts (#297 #298)
* Fix timezones for DateTimeLine for python 2 (#306, #302)
2.1.1
=====

3
pygal/test/test_date.py

@ -172,4 +172,5 @@ def test_utc_timestamping():
datetime(1999, 12, 31, 23, 59, 59),
datetime(2000, 1, 1, 0, 0, 0)
):
assert datetime.utcfromtimestamp(timestamp(d)) == d
assert datetime.utcfromtimestamp(
timestamp(d)) - d < timedelta(microseconds=10)

Loading…
Cancel
Save