diff --git a/src/tests/helpers/test_daterange.py b/src/tests/helpers/test_daterange.py index 42be63234..9fc493450 100644 --- a/src/tests/helpers/test_daterange.py +++ b/src/tests/helpers/test_daterange.py @@ -43,15 +43,15 @@ from pretix.helpers.daterange import daterange, datetimerange def test_same_day_german(): with translation.override('de'): df = date(2003, 2, 1) - assert daterange(df, df) == "1. Februar 2003" - assert daterange(df, df, as_html=True) == '' + assert daterange(df, df) == "Sa, 1. Februar 2003" + assert daterange(df, df, as_html=True) == '' def test_same_day_english(): with translation.override('en'): df = date(2003, 2, 1) - assert daterange(df, df) == "Feb. 1st, 2003" - assert daterange(df, df, as_html=True) == '' + assert daterange(df, df) == "Sat, Feb. 1st, 2003" + assert daterange(df, df, as_html=True) == '' def test_same_day_spanish(): diff --git a/src/tests/presale/test_widget.py b/src/tests/presale/test_widget.py index 8baf7fc1a..43ad33a9a 100644 --- a/src/tests/presale/test_widget.py +++ b/src/tests/presale/test_widget.py @@ -169,7 +169,7 @@ class WidgetCartTest(CartTestMixin, TestCase): "target_url": "http://example.com/ccc/30c3/", "subevent": None, "name": "30C3", - "date_range": f"Dec. 26, {self.event.date_from.year} 00:00", + "date_range": f"{self.event.date_from.strftime('%a')}, Dec. 26th, {self.event.date_from.year} 00:00", "frontpage_text": "", "location": "", "currency": "EUR", @@ -375,7 +375,7 @@ class WidgetCartTest(CartTestMixin, TestCase): "target_url": "http://example.com/ccc/30c3/", "subevent": None, "name": "30C3", - "date_range": f"Dec. 26, {self.event.date_from.year} 00:00", + "date_range": f"{self.event.date_from.strftime('%a')}, Dec. 26th, {self.event.date_from.year} 00:00", "frontpage_text": "", "location": "", "currency": "EUR", @@ -435,7 +435,7 @@ class WidgetCartTest(CartTestMixin, TestCase): "target_url": "http://example.com/ccc/30c3/", "subevent": None, "name": "30C3", - "date_range": f"Dec. 26, {self.event.date_from.year} 00:00", + "date_range": f"{self.event.date_from.strftime('%a')}, Dec. 26th, {self.event.date_from.year} 00:00", "frontpage_text": "", "location": "", "currency": "EUR", @@ -520,7 +520,7 @@ class WidgetCartTest(CartTestMixin, TestCase): "target_url": "http://example.com/ccc/30c3/", "subevent": None, "name": "30C3", - "date_range": f"Dec. 26, {self.event.date_from.year} 00:00", + "date_range": f"{self.event.date_from.strftime('%a')}, Dec. 26th, {self.event.date_from.year} 00:00", "frontpage_text": "", "location": "", "currency": "EUR", @@ -627,9 +627,9 @@ class WidgetCartTest(CartTestMixin, TestCase): 'poweredby': 'ticketing powered by pretix', 'has_more_events': False, 'events': [ - {'name': 'Present', 'date_range': 'Jan. 1, 2019 11:00', 'availability': {'color': 'none', 'text': 'More info', 'reason': 'unknown'}, + {'name': 'Present', 'date_range': 'Tue, Jan. 1st, 2019 11:00', 'availability': {'color': 'none', 'text': 'More info', 'reason': 'unknown'}, 'event_url': 'http://example.com/ccc/30c3/', 'subevent': se1.pk, 'location': ''}, - {'name': 'Future', 'date_range': 'Jan. 4, 2019 11:00', 'availability': {'color': 'none', 'text': 'More info', 'reason': 'unknown'}, + {'name': 'Future', 'date_range': 'Fri, Jan. 4th, 2019 11:00', 'availability': {'color': 'none', 'text': 'More info', 'reason': 'unknown'}, 'event_url': 'http://example.com/ccc/30c3/', 'subevent': se2.pk, 'location': ''} ] } @@ -659,14 +659,14 @@ class WidgetCartTest(CartTestMixin, TestCase): [ None, {'day': 1, 'date': '2019-01-01', 'events': [ - {'name': 'Present', 'time': '11:00', 'continued': False, 'date_range': 'Jan. 1, 2019 11:00', + {'name': 'Present', 'time': '11:00', 'continued': False, 'date_range': 'Tue, Jan. 1st, 2019 11:00', 'location': '', 'availability': {'color': 'none', 'text': 'More info', 'reason': 'unknown'}, 'event_url': 'http://example.com/ccc/30c3/', 'subevent': se1.pk}]}, {'day': 2, 'date': '2019-01-02', 'events': []}, {'day': 3, 'date': '2019-01-03', 'events': []}, {'day': 4, 'date': '2019-01-04', 'events': [ - {'name': 'Future', 'time': '11:00', 'continued': False, 'date_range': 'Jan. 4, 2019 11:00', + {'name': 'Future', 'time': '11:00', 'continued': False, 'date_range': 'Fri, Jan. 4th, 2019 11:00', 'location': '', 'availability': {'color': 'none', 'text': 'More info', 'reason': 'unknown'}, 'event_url': 'http://example.com/ccc/30c3/', 'subevent': se2.pk}]}, @@ -734,14 +734,14 @@ class WidgetCartTest(CartTestMixin, TestCase): 'days': [ {'day_formatted': 'Mon, Dec 31st', 'date': '2018-12-31', 'events': [], 'today': False}, {'day_formatted': 'Tue, Jan 1st', 'date': '2019-01-01', 'events': [ - {'name': 'Present', 'time': '11:00', 'continued': False, 'date_range': 'Jan. 1, 2019 11:00', + {'name': 'Present', 'time': '11:00', 'continued': False, 'date_range': 'Tue, Jan. 1st, 2019 11:00', 'location': '', 'availability': {'color': 'none', 'text': 'More info', 'reason': 'unknown'}, 'event_url': 'http://example.com/ccc/30c3/', 'subevent': se1.pk}], 'today': True}, {'day_formatted': 'Wed, Jan 2nd', 'date': '2019-01-02', 'events': [], 'today': False}, {'day_formatted': 'Thu, Jan 3rd', 'date': '2019-01-03', 'events': [], 'today': False}, {'day_formatted': 'Fri, Jan 4th', 'date': '2019-01-04', 'events': [ - {'name': 'Future', 'time': '11:00', 'continued': False, 'date_range': 'Jan. 4, 2019 11:00', + {'name': 'Future', 'time': '11:00', 'continued': False, 'date_range': 'Fri, Jan. 4th, 2019 11:00', 'location': '', 'availability': {'color': 'none', 'text': 'More info', 'reason': 'unknown'}, 'event_url': 'http://example.com/ccc/30c3/', 'subevent': se2.pk}], 'today': False}, @@ -778,12 +778,12 @@ class WidgetCartTest(CartTestMixin, TestCase): 'location': '', 'name': '30C3'}, {'availability': {'color': 'none', 'text': 'More info', 'reason': 'unknown'}, - 'date_range': 'Jan. 1, 2019 10:00', + 'date_range': 'Tue, Jan. 1st, 2019 10:00', 'location': '', 'event_url': 'http://example.com/ccc/present/', 'name': 'Present'}, {'availability': {'color': 'none', 'text': 'More info', 'reason': 'unknown'}, - 'date_range': 'Jan. 4, 2019 10:00', + 'date_range': 'Fri, Jan. 4th, 2019 10:00', 'location': '', 'event_url': 'http://example.com/ccc/future/', 'name': 'Future'} @@ -884,7 +884,7 @@ class WidgetCartTest(CartTestMixin, TestCase): 'day': 1, 'events': [{'availability': {'color': 'none', 'text': 'More info', 'reason': 'unknown'}, 'continued': False, - 'date_range': 'Jan. 1, 2019 10:00', + 'date_range': 'Tue, Jan. 1st, 2019 10:00', 'event_url': 'http://example.com/ccc/present/', 'name': 'Present', 'location': '', @@ -892,7 +892,7 @@ class WidgetCartTest(CartTestMixin, TestCase): 'time': '10:00'}, {'availability': {'color': 'none', 'text': 'More info', 'reason': 'unknown'}, 'continued': False, - 'date_range': 'Jan. 1, 2019 11:00', + 'date_range': 'Tue, Jan. 1st, 2019 11:00', 'event_url': 'http://example.com/ccc/30c3/', 'name': 'Present', 'location': '', @@ -904,7 +904,7 @@ class WidgetCartTest(CartTestMixin, TestCase): 'day': 4, 'events': [{'availability': {'color': 'none', 'text': 'More info', 'reason': 'unknown'}, 'continued': False, - 'date_range': 'Jan. 4, 2019 10:00', + 'date_range': 'Fri, Jan. 4th, 2019 10:00', 'event_url': 'http://example.com/ccc/future/', 'name': 'Future', 'location': '', @@ -912,7 +912,7 @@ class WidgetCartTest(CartTestMixin, TestCase): 'time': '10:00'}, {'availability': {'color': 'none', 'text': 'More info', 'reason': 'unknown'}, 'continued': False, - 'date_range': 'Jan. 4, 2019 11:00', + 'date_range': 'Fri, Jan. 4th, 2019 11:00', 'event_url': 'http://example.com/ccc/30c3/', 'name': 'Future', 'location': '',