Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Slovenian holidays. #124

Merged
merged 1 commit into from
Mar 7, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ Europe
* Sweden
* United Kingdom (incl. Northern Ireland)
* Spain
* Slovenia

America
-------
Expand Down
20 changes: 20 additions & 0 deletions workalendar/europe.py
Original file line number Diff line number Diff line change
Expand Up @@ -631,3 +631,23 @@ class Spain(WesternCalendar, ChristianMixin):
(10, 12, u"Fiesta nacional de España"),
(12, 6, u"Día de la Constitución Española")
)


class Slovenia(WesternCalendar, ChristianMixin):
"Slovenia"
include_easter_sunday = True
include_easter_monday = True
include_whit_sunday = True
include_assumption = True
include_christmas = True

FIXED_HOLIDAYS = WesternCalendar.FIXED_HOLIDAYS + (
(2, 8, "Preseren Day, the Slovenian Cultural Holiday"),
(4, 27, "Day of Uprising Against Occupation"),
(5, 1, "Labour Day"),
(5, 2, "Labour Day"),
(6, 25, "Statehood Day"),
(10, 31, "Reformation Day"),
(11, 1, "Day of Remembrance of the Dead"),
(12, 26, "Independence and Unity Day"),
)
39 changes: 39 additions & 0 deletions workalendar/tests/test_europe.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from workalendar.europe import Poland
from workalendar.europe import Portugal
from workalendar.europe import Spain
from workalendar.europe import Slovenia
from workalendar.europe import UnitedKingdom
from workalendar.europe import UnitedKingdomNorthernIreland
from workalendar.europe import EuropeanCentralBank
Expand Down Expand Up @@ -780,3 +781,41 @@ def test_year_2016(self):
self.assertIn(date(2016, 11, 1), holidays)
self.assertIn(date(2016, 12, 6), holidays)
self.assertIn(date(2016, 12, 8), holidays)


class SloveniaTest(GenericCalendarTest):
cal_class = Slovenia

def test_year_2015(self):
holidays = self.cal.holidays_set(2015)
self.assertIn(date(2015, 1, 1), holidays)
self.assertIn(date(2015, 2, 8), holidays)
self.assertIn(date(2015, 4, 5), holidays)
self.assertIn(date(2015, 4, 6), holidays)
self.assertIn(date(2015, 4, 27), holidays)
self.assertIn(date(2015, 5, 1), holidays)
self.assertIn(date(2015, 5, 2), holidays)
self.assertIn(date(2015, 5, 24), holidays)
self.assertIn(date(2015, 6, 25), holidays)
self.assertIn(date(2015, 8, 15), holidays)
self.assertIn(date(2015, 10, 31), holidays)
self.assertIn(date(2015, 11, 1), holidays)
self.assertIn(date(2015, 12, 25), holidays)
self.assertIn(date(2015, 12, 26), holidays)

def test_year_2016(self):
holidays = self.cal.holidays_set(2016)
self.assertIn(date(2016, 1, 1), holidays)
self.assertIn(date(2016, 2, 8), holidays)
self.assertIn(date(2016, 3, 27), holidays)
self.assertIn(date(2016, 3, 28), holidays)
self.assertIn(date(2016, 4, 27), holidays)
self.assertIn(date(2016, 5, 1), holidays)
self.assertIn(date(2016, 5, 2), holidays)
self.assertIn(date(2016, 5, 15), holidays)
self.assertIn(date(2016, 6, 25), holidays)
self.assertIn(date(2016, 8, 15), holidays)
self.assertIn(date(2016, 10, 31), holidays)
self.assertIn(date(2016, 11, 1), holidays)
self.assertIn(date(2016, 12, 25), holidays)
self.assertIn(date(2016, 12, 26), holidays)