forked from CGM_Public/pretix_original
Show weekday in subevent dates [Z#23161884] (#4383)
This commit is contained in:
@@ -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) == '<time datetime="2003-02-01">1. Februar 2003</time>'
|
||||
assert daterange(df, df) == "Sa, 1. Februar 2003"
|
||||
assert daterange(df, df, as_html=True) == '<time datetime="2003-02-01">Sa, 1. Februar 2003</time>'
|
||||
|
||||
|
||||
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) == '<time datetime="2003-02-01">Feb. 1st, 2003</time>'
|
||||
assert daterange(df, df) == "Sat, Feb. 1st, 2003"
|
||||
assert daterange(df, df, as_html=True) == '<time datetime="2003-02-01">Sat, Feb. 1st, 2003</time>'
|
||||
|
||||
|
||||
def test_same_day_spanish():
|
||||
|
||||
@@ -1599,7 +1599,7 @@ class EventLocaleTest(EventTestMixin, SoupTest):
|
||||
'/%s/%s/' % (self.orga.slug, self.event.slug)
|
||||
)
|
||||
self.assertEqual(response.status_code, 200)
|
||||
self.assertIn('Dec. 26,', response.rendered_content)
|
||||
self.assertIn('Fri, Dec. 26th,', response.rendered_content)
|
||||
self.assertIn('14:00', response.rendered_content)
|
||||
|
||||
def test_english_region_US(self):
|
||||
@@ -1609,7 +1609,7 @@ class EventLocaleTest(EventTestMixin, SoupTest):
|
||||
'/%s/%s/' % (self.orga.slug, self.event.slug)
|
||||
)
|
||||
self.assertEqual(response.status_code, 200)
|
||||
self.assertIn('Dec. 26,', response.rendered_content)
|
||||
self.assertIn('Fri, Dec. 26th,', response.rendered_content)
|
||||
self.assertIn('2 p.m.', response.rendered_content)
|
||||
|
||||
def test_german_region_US(self):
|
||||
@@ -1619,5 +1619,5 @@ class EventLocaleTest(EventTestMixin, SoupTest):
|
||||
'/%s/%s/' % (self.orga.slug, self.event.slug)
|
||||
)
|
||||
self.assertEqual(response.status_code, 200)
|
||||
self.assertIn('26. Dezember', response.rendered_content)
|
||||
self.assertIn('Fr, 26. Dezember', response.rendered_content)
|
||||
self.assertIn('14:00', response.rendered_content)
|
||||
|
||||
@@ -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': '<a href="https://pretix.eu" target="_blank" rel="noopener">ticketing powered by pretix</a>',
|
||||
'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': '',
|
||||
|
||||
Reference in New Issue
Block a user