diff --git a/combo_plugin_gnm/templatetags/gnm.py b/combo_plugin_gnm/templatetags/gnm.py index 35e14d2..b466e53 100644 --- a/combo_plugin_gnm/templatetags/gnm.py +++ b/combo_plugin_gnm/templatetags/gnm.py @@ -80,8 +80,6 @@ def get_open_close_from_specification(specification, valid_from, base_datetime): ''' opening_time = datetime.datetime.combine(base_datetime, dateutil_parse(specification['opens']).time()) closing_time = datetime.datetime.combine(base_datetime, dateutil_parse(specification['closes']).time()) - opening_time = opening_time.replace(tzinfo=valid_from.tzinfo) - closing_time = closing_time.replace(tzinfo=valid_from.tzinfo) if not isinstance(specification['dayOfWeek'], str): raise ValueError() day_number = EN_FULL_WEEKDAYS_LIST.index(specification['dayOfWeek'].split('/')[-1]) diff --git a/tests/test_as_opening_hours.py b/tests/test_as_opening_hours.py index 423e334..677f326 100644 --- a/tests/test_as_opening_hours.py +++ b/tests/test_as_opening_hours.py @@ -93,7 +93,7 @@ def test_jonage_open(): assert test_html == mark_safe(u'
%s
' % (klass, label)) -@pytest.mark.freeze_time("2018-03-05 10:32:00") +@pytest.mark.freeze_time("2018-03-05 11:32:00") def test_jonage_soon_to_be_closed(): "Jonage is defined only by openinghoursspecification data" test_html = [as_opening_hours_badge(x) for x in GEOJSON if x['properties']['nom'] == 'Mairie de Jonage'][0] @@ -215,7 +215,7 @@ def test_mairie_format_openinghours(openinghour, badge, text): ('Tuesday', '14:30', '17:45', 'closed', 'Réouvre demain à 14h30'), ('Monday', '14:30', '17:45', 'closed', 'Réouvre à 14h30'), ('Monday', '08:30', '11:45', 'closed', 'Ouvre à 8h30'), - ('Monday', '00:00', '00:45', 'closed', 'Fermé'), # wrong + ('Monday', '00:00', '00:45', 'soon-to-be-closed', "Ouvert jusqu'à 0h45"), ('Sunday', '20:30', '00:45', 'closed', 'Réouvre dimanche à 20h30'), # wrong ]) def test_mairie_format_openinghoursspecification(day, opens, closes, badge, text):