Timezone parsing fix

This commit is contained in:
Manuel Ebert 2014-10-21 18:27:56 +02:00
parent 4256052e90
commit 5b5c7cb6e8

View file

@ -124,10 +124,8 @@ def check_output(context, text=None):
def check_output_time_inline(context, text): def check_output_time_inline(context, text):
out = context.stdout_capture.getvalue() out = context.stdout_capture.getvalue()
local_tz = tzlocal.get_localzone() local_tz = tzlocal.get_localzone()
utc_time = date_parser.parse(text) local_time = date_parser.parse(text).astimezone(local_tz).strftime("%Y-%m-%d %H:%M")
date = utc_time + local_tz._utcoffset assert local_time in out, local_time
local_date = date.strftime("%Y-%m-%d %H:%M")
assert local_date in out, local_date
@then('the output should contain "{text}"') @then('the output should contain "{text}"')
def check_output_inline(context, text): def check_output_inline(context, text):