diff --git a/README.rst b/README.rst index c6bc670d7..dfc8ac832 100644 --- a/README.rst +++ b/README.rst @@ -268,7 +268,7 @@ The list of supported countries, their subdivisions and supported languages * - Curacao - CW - - - + - en_US, nl, **pap**, uk * - Cyprus - CY - diff --git a/holidays/countries/curacao.py b/holidays/countries/curacao.py index 5bbb06e6d..b8a10c44b 100644 --- a/holidays/countries/curacao.py +++ b/holidays/countries/curacao.py @@ -11,81 +11,135 @@ from datetime import date from datetime import timedelta as td +from gettext import gettext as tr -from dateutil.easter import easter - -from holidays.constants import JAN, APR, MAY, JUL, AUG, OCT, DEC +from holidays.constants import APR, MAY, JUL, OCT from holidays.holiday_base import HolidayBase +from holidays.holiday_groups import ChristianHolidays, InternationalHolidays -class Curacao(HolidayBase): +class Curacao(HolidayBase, ChristianHolidays, InternationalHolidays): """ - https://loketdigital.gobiernu.cw/Loket/product/571960bbe1e5fe8712b10a1323630e70 + https://loketdigital.gobiernu.cw/Loket/product/571960bbe1e5fe8712b10a1323630e70 # noqa: E501 + https://en.wikipedia.org/wiki/Public_holidays_in_Cura%C3%A7ao + + New Year's Eve (Vispu di Aña Nobo) is a half-day public holiday, though + this isn't supported by Python Holidays so it won't be implemented. """ country = "CW" + default_language = "pap" + supported_languages = ("en_US", "nl", "pap", "uk") + + def __init__(self, *args, **kwargs): + ChristianHolidays.__init__(self) + InternationalHolidays.__init__(self) + super().__init__(*args, **kwargs) def _populate(self, year): + # 1954: Creation of the Netherlands Antilles. + if year <= 1953: + return None + super()._populate(year) + # Aña Nobo. + # Status: In-Use. + # New Year's Day - self[date(year, JAN, 1)] = "Nieuwjaarsdag [New Year's Day]" + self._add_new_years_day(tr("Aña Nobo")) + + # Dialuna despues di Carnaval Grandi. + # Status: In-Use. + # Started in 1947. + + # Carnival Monday + self._add_ash_monday(tr("Dialuna despues di Carnaval Grandi")) - easter_date = easter(year) - # Carnaval Monday - self[ - easter_date + td(days=-48) - ] = "Maandag na de Grote Karnaval [Carnaval Monday]" + # Bièrnèsantu. + # Status: In-Use. # Good Friday - self[easter_date + td(days=-2)] = "Goede Vrijdag [Good Friday]" + self._add_good_friday(tr("Bièrnèsantu")) - # Easter Monday - self[ - easter_date + td(days=+1) - ] = "Di Dos Dia di Pasku di Resureccion [Easter Monday]" + # Pasku di Resurekshon. + # Status: In-Use - # King's Day - if year >= 2014: - kings_day = date(year, APR, 27) - if self._is_sunday(kings_day): - kings_day += td(days=-1) + # Easter Sunday + self._add_easter_sunday(tr("Pasku di Resurekshon")) - self[kings_day] = "Koningsdag [King's Day]" + # Di dos dia di Pasku di Resurekshon. + # Status: In-Use. - # Queen's Day - if 1891 <= year <= 2013: - queens_day = date(year, APR, 30) - if year <= 1948: - queens_day = date(year, AUG, 31) + # Easter Monday + self._add_easter_monday(tr("Di dos dia di Pasku di Resurekshon")) + + # Dia di la Reina/Dia di Rey. + # Status: In-Use. + # Started under Queen Wilhelmina in 1891. + # Queen Beatrix kept Queen Juliana's Birthday after her coronation. + # Switched to Aña di Rey in 2014 for King Willem-Alexander. + # Have its name changed again to Dia di Rey from 2021 onwards. + + # King's / Queen's Day + name = ( + # King's Day. + tr("Dia di Rey") + if year >= 2014 + # Queen's Day. + else tr("Dia di la Reina") + ) + if year >= 2014: + dt = date(year, APR, 27) + else: + dt = date(year, APR, 30) + if self._is_sunday(dt): + dt += td(days=-1) if year >= 1980 else td(days=+1) + self._add_holiday(name, dt) + + # Dia di Obrero. + # Status: In-Use. + # If fall on Sunday, then this will be move to next working day. + + dt = date(year, MAY, 1) + if self._is_sunday(dt) or (self._is_monday(dt) and year <= 1979): + dt += td(days=+1) + # Labor Day + self._add_holiday(tr("Dia di Obrero"), dt) + + # Dia di Asenshon. + # Status: In-Use. - if self._is_sunday(queens_day): - queens_day += td(days=1) if year < 1980 else td(days=-1) + # Ascension Day + self._add_ascension_thursday(tr("Dia di Asenshon")) - self[queens_day] = "Anja di La Reina [Queen's Day]" + # Dia di Himno i Bandera. + # Status: In-Use. + # Starts in 1984. - # Labour Day - labour_day = date(year, MAY, 1) - if self._is_sunday(labour_day): - labour_day += td(days=+1) - self[labour_day] = "Dia di Obrero [Labour Day]" + if year >= 1984: + # National Anthem and Flag Day + self._add_holiday(tr("Dia di Himno i Bandera"), JUL, 2) - # Ascension Day - self[easter_date + td(days=+39)] = "Hemelvaartsdag [Ascension Day]" + # Dia di Pais Kòrsou / Dia di autonomia. + # Status: In-Use. + # Starts in 2010. - # Dia di Himno y Bandera - self[ - date(year, JUL, 2) - ] = "Dia di Himno y Bandera [National Anthem & Flag Day]" + if year >= 2010: + # Curaçao Day + self._add_holiday(tr("Dia di Pais Kòrsou"), OCT, 10) - # Dia di Pais Kòrsou - self[date(year, OCT, 10)] = "Dia di Pais Kòrsou [Curaçao Day]" + # Pasku di Nasementu. + # Status: In-Use. # Christmas Day - self[date(year, DEC, 25)] = "Kerstdag [Christmas]" + self._add_christmas_day(tr("Pasku di Nasementu")) + + # Di dos dia di Pasku di Nasementu. + # Status: In-Use. - # Second Christmas - self[date(year, DEC, 26)] = "2de Kerstdag [Second Christmas]" + # Second Day of Christmas + self._add_christmas_day_two(tr("Di dos dia di Pasku di Nasementu")) class CW(Curacao): diff --git a/holidays/locale/en_US/LC_MESSAGES/CW.po b/holidays/locale/en_US/LC_MESSAGES/CW.po new file mode 100644 index 000000000..be6c22362 --- /dev/null +++ b/holidays/locale/en_US/LC_MESSAGES/CW.po @@ -0,0 +1,82 @@ +# Curacao holidays en_US localization. +# Authors: PPsyrius , (c) 2023. +# +msgid "" +msgstr "" +"Project-Id-Version: Python Holidays 0.27\n" +"POT-Creation-Date: 2023-06-13 16:35+0700\n" +"PO-Revision-Date: \n" +"Last-Translator: PPsyrius \n" +"Language-Team: Python Holidays localization team\n" +"Language: en_US\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"Generated-By: pygettext.py 1.5\n" +"X-Generator: Poedit 3.3.1\n" + +#. New Year's Day +#: ./holidays/countries/curacao.py:50 +msgid "Aña Nobo" +msgstr "New Year's Day" + +#. Carnival Monday +#: ./holidays/countries/curacao.py:57 +msgid "Dialuna despues di Carnaval Grandi" +msgstr "Carnival Monday" + +#. Good Friday +#: ./holidays/countries/curacao.py:63 +msgid "Bièrnèsantu" +msgstr "Good Friday" + +#. Easter Sunday +#: ./holidays/countries/curacao.py:69 +msgid "Pasku di Resurekshon" +msgstr "Easter Sunday" + +#. Easter Monday +#: ./holidays/countries/curacao.py:75 +msgid "Di dos dia di Pasku di Resurekshon" +msgstr "Easter Monday" + +#. King's Day. +#: ./holidays/countries/curacao.py:87 +msgid "Dia di Rey" +msgstr "King's Day" + +#. Queen's Day. +#: ./holidays/countries/curacao.py:90 +msgid "Dia di la Reina" +msgstr "Queen's Day" + +#. Labor Day +#: ./holidays/countries/curacao.py:108 +msgid "Dia di Obrero" +msgstr "Labor Day" + +#. Ascension Day +#: ./holidays/countries/curacao.py:114 +msgid "Dia di Asenshon" +msgstr "Ascension Day" + +#. National Anthem and Flag Day +#: ./holidays/countries/curacao.py:122 +msgid "Dia di Himno i Bandera" +msgstr "National Anthem and Flag Day" + +#. Curaçao Day +#: ./holidays/countries/curacao.py:130 +msgid "Dia di Pais Kòrsou" +msgstr "Curaçao Day" + +#. Christmas Day +#: ./holidays/countries/curacao.py:136 +msgid "Pasku di Nasementu" +msgstr "Christmas Day" + +#. Second Day of Christmas +#: ./holidays/countries/curacao.py:142 +msgid "Di dos dia di Pasku di Nasementu" +msgstr "Second Day of Christmas" diff --git a/holidays/locale/nl/LC_MESSAGES/CW.po b/holidays/locale/nl/LC_MESSAGES/CW.po new file mode 100644 index 000000000..dc12e589d --- /dev/null +++ b/holidays/locale/nl/LC_MESSAGES/CW.po @@ -0,0 +1,82 @@ +# Curacao holidays nl localization. +# Authors: PPsyrius , (c) 2023. +# +msgid "" +msgstr "" +"Project-Id-Version: Python Holidays 0.27\n" +"POT-Creation-Date: 2023-06-13 16:35+0700\n" +"PO-Revision-Date: \n" +"Last-Translator: PPsyrius \n" +"Language-Team: Python Holidays localization team\n" +"Language: nl\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"Generated-By: pygettext.py 1.5\n" +"X-Generator: Poedit 3.3.1\n" + +#. New Year's Day +#: ./holidays/countries/curacao.py:50 +msgid "Aña Nobo" +msgstr "Nieuwjaarsdag" + +#. Carnival Monday +#: ./holidays/countries/curacao.py:57 +msgid "Dialuna despues di Carnaval Grandi" +msgstr "De maandag na de Grote Karnaval" + +#. Good Friday +#: ./holidays/countries/curacao.py:63 +msgid "Bièrnèsantu" +msgstr "Goede Vrijdag" + +#. Easter Sunday +#: ./holidays/countries/curacao.py:69 +msgid "Pasku di Resurekshon" +msgstr "Paasdag" + +#. Easter Monday +#: ./holidays/countries/curacao.py:75 +msgid "Di dos dia di Pasku di Resurekshon" +msgstr "Tweede paasdag" + +#. King's Day. +#: ./holidays/countries/curacao.py:87 +msgid "Dia di Rey" +msgstr "Koningsdag" + +#. Queen's Day. +#: ./holidays/countries/curacao.py:90 +msgid "Dia di la Reina" +msgstr "Koninginnedag" + +#. Labor Day +#: ./holidays/countries/curacao.py:108 +msgid "Dia di Obrero" +msgstr "Dag van de Arbeid" + +#. Ascension Day +#: ./holidays/countries/curacao.py:114 +msgid "Dia di Asenshon" +msgstr "Hemelvaartsdag" + +#. National Anthem and Flag Day +#: ./holidays/countries/curacao.py:122 +msgid "Dia di Himno i Bandera" +msgstr "Nationale vlag en volkslied" + +#. Curaçao Day +#: ./holidays/countries/curacao.py:130 +msgid "Dia di Pais Kòrsou" +msgstr "Dag van Land Curaçao" + +#. Christmas Day +#: ./holidays/countries/curacao.py:136 +msgid "Pasku di Nasementu" +msgstr "Kerst" + +#. Second Day of Christmas +#: ./holidays/countries/curacao.py:142 +msgid "Di dos dia di Pasku di Nasementu" +msgstr "Tweede kerstdag" diff --git a/holidays/locale/pap/LC_MESSAGES/CW.po b/holidays/locale/pap/LC_MESSAGES/CW.po new file mode 100644 index 000000000..ed217ac3a --- /dev/null +++ b/holidays/locale/pap/LC_MESSAGES/CW.po @@ -0,0 +1,82 @@ +# Curacao holidays. +# Authors: PPsyrius , (c) 2023. +# +msgid "" +msgstr "" +"Project-Id-Version: Python Holidays 0.27\n" +"POT-Creation-Date: 2023-06-13 16:35+0700\n" +"PO-Revision-Date: \n" +"Last-Translator: PPsyrius \n" +"Language-Team: Python Holidays localization team\n" +"Language: pap\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"Generated-By: pygettext.py 1.5\n" +"X-Generator: Poedit 3.3.1\n" + +#. New Year's Day +#: ./holidays/countries/curacao.py:50 +msgid "Aña Nobo" +msgstr "" + +#. Carnival Monday +#: ./holidays/countries/curacao.py:57 +msgid "Dialuna despues di Carnaval Grandi" +msgstr "" + +#. Good Friday +#: ./holidays/countries/curacao.py:63 +msgid "Bièrnèsantu" +msgstr "" + +#. Easter Sunday +#: ./holidays/countries/curacao.py:69 +msgid "Pasku di Resurekshon" +msgstr "" + +#. Easter Monday +#: ./holidays/countries/curacao.py:75 +msgid "Di dos dia di Pasku di Resurekshon" +msgstr "" + +#. King's Day. +#: ./holidays/countries/curacao.py:87 +msgid "Dia di Rey" +msgstr "" + +#. Queen's Day. +#: ./holidays/countries/curacao.py:90 +msgid "Dia di la Reina" +msgstr "" + +#. Labor Day +#: ./holidays/countries/curacao.py:108 +msgid "Dia di Obrero" +msgstr "" + +#. Ascension Day +#: ./holidays/countries/curacao.py:114 +msgid "Dia di Asenshon" +msgstr "" + +#. National Anthem and Flag Day +#: ./holidays/countries/curacao.py:122 +msgid "Dia di Himno i Bandera" +msgstr "" + +#. Curaçao Day +#: ./holidays/countries/curacao.py:130 +msgid "Dia di Pais Kòrsou" +msgstr "" + +#. Christmas Day +#: ./holidays/countries/curacao.py:136 +msgid "Pasku di Nasementu" +msgstr "" + +#. Second Day of Christmas +#: ./holidays/countries/curacao.py:142 +msgid "Di dos dia di Pasku di Nasementu" +msgstr "" diff --git a/holidays/locale/uk/LC_MESSAGES/CW.po b/holidays/locale/uk/LC_MESSAGES/CW.po new file mode 100644 index 000000000..cb87407cc --- /dev/null +++ b/holidays/locale/uk/LC_MESSAGES/CW.po @@ -0,0 +1,82 @@ +# Curacao holidays uk localization. +# Authors: ~Jhellico , (c) 2023. +# +msgid "" +msgstr "" +"Project-Id-Version: Python Holidays 0.27\n" +"POT-Creation-Date: 2023-06-13 16:35+0700\n" +"PO-Revision-Date: \n" +"Last-Translator: ~Jhellico \n" +"Language-Team: Python Holidays localization team\n" +"Language: uk\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : 2);\n" +"Generated-By: pygettext.py 1.5\n" +"X-Generator: Poedit 3.3.1\n" + +#. New Year's Day +#: ./holidays/countries/curacao.py:50 +msgid "Aña Nobo" +msgstr "Новий рік" + +#. Carnival Monday +#: ./holidays/countries/curacao.py:57 +msgid "Dialuna despues di Carnaval Grandi" +msgstr "Карнавальний понеділок" + +#. Good Friday +#: ./holidays/countries/curacao.py:63 +msgid "Bièrnèsantu" +msgstr "Страсна пʼятниця" + +#. Easter Sunday +#: ./holidays/countries/curacao.py:69 +msgid "Pasku di Resurekshon" +msgstr "Великдень" + +#. Easter Monday +#: ./holidays/countries/curacao.py:75 +msgid "Di dos dia di Pasku di Resurekshon" +msgstr "Великодній понеділок" + +#. King's Day. +#: ./holidays/countries/curacao.py:87 +msgid "Dia di Rey" +msgstr "День короля" + +#. Queen's Day. +#: ./holidays/countries/curacao.py:90 +msgid "Dia di la Reina" +msgstr "День королеви" + +#. Labor Day +#: ./holidays/countries/curacao.py:108 +msgid "Dia di Obrero" +msgstr "День праці" + +#. Ascension Day +#: ./holidays/countries/curacao.py:114 +msgid "Dia di Asenshon" +msgstr "Вознесіння Господнє" + +#. National Anthem and Flag Day +#: ./holidays/countries/curacao.py:122 +msgid "Dia di Himno i Bandera" +msgstr "День державного гімну та прапора" + +#. Curaçao Day +#: ./holidays/countries/curacao.py:130 +msgid "Dia di Pais Kòrsou" +msgstr "День Кюрасао" + +#. Christmas Day +#: ./holidays/countries/curacao.py:136 +msgid "Pasku di Nasementu" +msgstr "Різдво Христове" + +#. Second Day of Christmas +#: ./holidays/countries/curacao.py:142 +msgid "Di dos dia di Pasku di Nasementu" +msgstr "Другий день Різдва" diff --git a/tests/countries/test_curacao.py b/tests/countries/test_curacao.py index 44bacbb6f..e29a5ead4 100644 --- a/tests/countries/test_curacao.py +++ b/tests/countries/test_curacao.py @@ -9,93 +9,187 @@ # Website: https://github.com/dr-prodigy/python-holidays # License: MIT (see LICENSE file) -import unittest -from datetime import date +from holidays.countries.curacao import Curacao, CW, CUW +from tests.common import TestCase -import holidays +class TestCuracao(TestCase): + @classmethod + def setUpClass(cls): + super().setUpClass(Curacao, years=range(1954, 2077)) -class TestCuracao(unittest.TestCase): - def setUp(self): - self.holidays = holidays.CW() + def test_country_aliases(self): + self.assertCountryAliases(Curacao, CW, CUW) - def test_2016(self): - self.assertIn(date(2016, 1, 1), self.holidays) - self.assertIn(date(2016, 2, 8), self.holidays) - self.assertIn(date(2016, 3, 25), self.holidays) - self.assertIn(date(2016, 3, 28), self.holidays) - self.assertIn(date(2016, 4, 27), self.holidays) - self.assertIn(date(2016, 5, 2), self.holidays) - self.assertIn(date(2016, 5, 5), self.holidays) - self.assertIn(date(2016, 7, 2), self.holidays) - self.assertIn(date(2016, 10, 10), self.holidays) - self.assertIn(date(2016, 12, 25), self.holidays) - self.assertIn(date(2016, 12, 26), self.holidays) - - def test_new_years(self): - self.assertIn(date(2016, 1, 1), self.holidays) - - def test_carnaval_monday(self): - self.assertIn(date(2016, 2, 8), self.holidays) - - def test_easter_monday(self): - self.assertIn(date(2016, 3, 28), self.holidays) - - def test_queens_day_between_1891_and_1948(self): - # Between 1891 and 1948 Queens Day was celebrated on 8-31 - self.holidays = holidays.CW(years=[1901]) - self.assertIn(date(1901, 8, 31), self.holidays) - - def test_queens_day_between_1891_and_1948_substituted_later(self): - # Between 1891 and 1948 Queens Day was celebrated on 9-1 - # (one day later) when Queens Day falls on a Sunday - self.holidays = holidays.CW(years=[1947]) - self.assertIn(date(1947, 9, 1), self.holidays) - - def test_queens_day_between_1949_and_2013(self): - self.holidays = holidays.CW(years=[1965]) - self.assertIn(date(1965, 4, 30), self.holidays) - - def test_queens_day_between_1949_and_1980_substituted_later(self): - self.holidays = holidays.CW(years=[1967]) - self.assertIn(date(1967, 5, 1), self.holidays) - - def test_queens_day_between_1980_and_2013_substituted_earlier(self): - self.holidays = holidays.CW(years=[2006]) - self.assertIn(date(2006, 4, 29), self.holidays) + def test_no_holidays(self): + self.assertNoHolidays(Curacao(years=1953)) - def test_kings_day_after_2014(self): - self.holidays = holidays.CW(years=[2013]) - self.assertNotIn(date(2013, 4, 27), self.holidays) - - self.holidays = holidays.CW(years=[2016]) - self.assertIn(date(2016, 4, 27), self.holidays) - - def test_kings_day_after_2014_substituted_earlier(self): - self.holidays = holidays.CW(years=[2188]) - self.assertIn(date(2188, 4, 26), self.holidays) - - def test_labour_day(self): - self.holidays = holidays.CW(years=[2016]) - self.assertNotIn(date(2016, 5, 1), self.holidays) - - self.holidays = holidays.CW(years=[2017]) - self.assertIn(date(2017, 5, 1), self.holidays) - - def test_ascension_day(self): - self.holidays = holidays.CW(years=2016) - self.assertIn(date(2016, 5, 5), self.holidays) - - def test_national_anthem_flagday(self): - self.assertIn(date(2016, 7, 2), self.holidays) + def test_2016(self): + self.assertHolidays( + Curacao(years=2016), + ("2016-01-01", "Aña Nobo"), + ("2016-02-08", "Dialuna despues di Carnaval Grandi"), + ("2016-03-25", "Bièrnèsantu"), + ("2016-03-27", "Pasku di Resurekshon"), + ("2016-03-28", "Di dos dia di Pasku di Resurekshon"), + ("2016-04-27", "Dia di Rey"), + ("2016-05-02", "Dia di Obrero"), + ("2016-05-05", "Dia di Asenshon"), + ("2016-07-02", "Dia di Himno i Bandera"), + ("2016-10-10", "Dia di Pais Kòrsou"), + ("2016-12-25", "Pasku di Nasementu"), + ("2016-12-26", "Di dos dia di Pasku di Nasementu"), + ) + + def test_queens_day(self): + name = "Dia di la Reina" + self.assertHolidayName( + name, + "1961-05-01", + "1965-04-30", + "1967-05-01", + "1972-05-01", + "1978-05-01", + "1989-04-29", + "1995-04-29", + "2000-04-29", + "2006-04-29", + "2013-04-30", + ) + self.assertNoHoliday( + "1961-04-30", + "1967-04-30", + "1972-04-30", + "1978-04-30", + "1995-04-30", + "1989-04-30", + "2000-04-30", + "2006-04-30", + ) + self.assertNoHolidayName(name, 2014) + + def test_king_day(self): + name = "Dia di Rey" + self.assertNoHolidayName(name, 2013) + self.assertHolidayName( + name, + "2016-04-27", + "2017-04-27", + "2018-04-27", + "2019-04-27", + "2020-04-27", + "2021-04-27", + "2022-04-27", + "2023-04-27", + "2024-04-27", + "2025-04-26", + "2031-04-26", + "2036-04-26", + ) + self.assertNoHoliday( + "2014-04-27", + "2025-04-27", + "2031-04-27", + "2036-04-27", + ) + + def test_labor_day(self): + self.assertHolidayName( + "Dia di Obrero", + "2016-05-02", + "2017-05-01", + "2018-05-01", + "2019-05-01", + "2020-05-01", + "2021-05-01", + "2022-05-02", + "2023-05-01", + ) + self.assertNoHoliday( + "2011-05-01", + "2016-05-01", + "2022-05-01", + ) + + def test_anthem_and_flag_day(self): + name = "Dia di Himno i Bandera" + self.assertNoHolidayName(name, 1983) + self.assertHolidayName( + name, + (f"{year}-07-02" for year in range(1984, 2077)), + ) def test_curacao_day(self): - self.assertIn(date(2016, 10, 10), self.holidays) - - def test_first_christmas(self): - self.holidays = holidays.CW(years=2016) - self.assertIn(date(2016, 12, 25), self.holidays) - - def test_second_christmas(self): - self.holidays = holidays.CW(years=2016) - self.assertIn(date(2016, 12, 26), self.holidays) + name = "Dia di Pais Kòrsou" + self.assertNoHolidayName(name, 2009) + self.assertHolidayName( + name, + (f"{year}-10-10" for year in range(2010, 2077)), + ) + + def test_l10n_default(self): + self.assertLocalizedHolidays( + ("2023-01-01", "Aña Nobo"), + ("2023-02-20", "Dialuna despues di Carnaval Grandi"), + ("2023-04-07", "Bièrnèsantu"), + ("2023-04-09", "Pasku di Resurekshon"), + ("2023-04-10", "Di dos dia di Pasku di Resurekshon"), + ("2023-04-27", "Dia di Rey"), + ("2023-05-01", "Dia di Obrero"), + ("2023-05-18", "Dia di Asenshon"), + ("2023-07-02", "Dia di Himno i Bandera"), + ("2023-10-10", "Dia di Pais Kòrsou"), + ("2023-12-25", "Pasku di Nasementu"), + ("2023-12-26", "Di dos dia di Pasku di Nasementu"), + ) + + def test_l10n_en_us(self): + self.assertLocalizedHolidays( + "en_US", + ("2023-01-01", "New Year's Day"), + ("2023-02-20", "Carnival Monday"), + ("2023-04-07", "Good Friday"), + ("2023-04-09", "Easter Sunday"), + ("2023-04-10", "Easter Monday"), + ("2023-04-27", "King's Day"), + ("2023-05-01", "Labor Day"), + ("2023-05-18", "Ascension Day"), + ("2023-07-02", "National Anthem and Flag Day"), + ("2023-10-10", "Curaçao Day"), + ("2023-12-25", "Christmas Day"), + ("2023-12-26", "Second Day of Christmas"), + ) + + def test_l10n_nl(self): + self.assertLocalizedHolidays( + "nl", + ("2023-01-01", "Nieuwjaarsdag"), + ("2023-02-20", "De maandag na de Grote Karnaval"), + ("2023-04-07", "Goede Vrijdag"), + ("2023-04-09", "Paasdag"), + ("2023-04-10", "Tweede paasdag"), + ("2023-04-27", "Koningsdag"), + ("2023-05-01", "Dag van de Arbeid"), + ("2023-05-18", "Hemelvaartsdag"), + ("2023-07-02", "Nationale vlag en volkslied"), + ("2023-10-10", "Dag van Land Curaçao"), + ("2023-12-25", "Kerst"), + ("2023-12-26", "Tweede kerstdag"), + ) + + def test_l10n_uk(self): + self.assertLocalizedHolidays( + "uk", + ("2023-01-01", "Новий рік"), + ("2023-02-20", "Карнавальний понеділок"), + ("2023-04-07", "Страсна пʼятниця"), + ("2023-04-09", "Великдень"), + ("2023-04-10", "Великодній понеділок"), + ("2023-04-27", "День короля"), + ("2023-05-01", "День праці"), + ("2023-05-18", "Вознесіння Господнє"), + ("2023-07-02", "День державного гімну та прапора"), + ("2023-10-10", "День Кюрасао"), + ("2023-12-25", "Різдво Христове"), + ("2023-12-26", "Другий день Різдва"), + )