From 5b5c7cb6e8e59754b44ba3bea698e3a2af23d6a1 Mon Sep 17 00:00:00 2001 From: Manuel Ebert Date: Tue, 21 Oct 2014 18:27:56 +0200 Subject: [PATCH] Timezone parsing fix --- features/steps/core.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/features/steps/core.py b/features/steps/core.py index c4aa2f59..9b0679e0 100644 --- a/features/steps/core.py +++ b/features/steps/core.py @@ -124,10 +124,8 @@ def check_output(context, text=None): def check_output_time_inline(context, text): out = context.stdout_capture.getvalue() local_tz = tzlocal.get_localzone() - utc_time = date_parser.parse(text) - date = utc_time + local_tz._utcoffset - local_date = date.strftime("%Y-%m-%d %H:%M") - assert local_date in out, local_date + local_time = date_parser.parse(text).astimezone(local_tz).strftime("%Y-%m-%d %H:%M") + assert local_time in out, local_time @then('the output should contain "{text}"') def check_output_inline(context, text):