Repository: peopledoc/workalendar (python)

Issue:
Add Berlin specific holidays
Recently in Berlin, Germany legislation was passed which added two public holidays:

- International Women's Day (from 2019 onwards)
- 75'th anniversary of the liberation from National Socialism and the end of World War II (2020 only)

source: §1 of http://gesetze.berlin.de/jportal/?quelle=jlink&query=FeiertG+BE&psml=bsbeprod.psml&max=true&aiz=true

Pull request description:
Add Berlin specific holidays. Fixes #340
closes #340 

- [X] Tests with a significant number of years to be tested for your calendar.
- [X] Changelog amended with a mention describing your changes.


Patch:
diff --git a/Changelog.md b/Changelog.md
index 518df09..1537de9 100644
--- a/Changelog.md
+++ b/Changelog.md
@@ -4,6 +4,7 @@
 
 - Added isolated tests for shifting mechanics in USA calendars - previously untested (#335).
 - Added Barbados by @ludsoft.
+- Added Berlin specific holidays (#340).
 
 ## v4.2.0 (2019-02-21)
 
diff --git a/workalendar/europe/germany.py b/workalendar/europe/germany.py
index c03551c..b97f32e 100644
--- a/workalendar/europe/germany.py
+++ b/workalendar/europe/germany.py
@@ -76,6 +76,22 @@ class Bavaria(Germany):
 class Berlin(Germany):
     'Berlin'
 
+    def get_international_womens_day(self, year):
+        day = date(year, 3, 8)
+        return (day, "International Women's Day")
+
+    def get_liberation_day(self, year):
+        day = date(year, 5, 8)
+        return (day, "Liberation Day")
+
+    def get_variable_days(self, year):
+        days = super(Berlin, self).get_variable_days(year)
+        if year >= 2019:
+            days.append(self.get_international_womens_day(year))
+        if year == 2020:
+            days.append(self.get_liberation_day(year))
+        return days
+
 
 @iso_register('DE-BB')
 class Brandenburg(Germany):


Test patch:
diff --git a/workalendar/tests/test_germany.py b/workalendar/tests/test_germany.py
index 5ef1e7f..4dea9fc 100644
--- a/workalendar/tests/test_germany.py
+++ b/workalendar/tests/test_germany.py
@@ -130,6 +130,26 @@ class BavariaTest(GenericCalendarTest):
 class BerlinTest(GermanyTest):
     cal_class = Berlin
 
+    def test_extra_2018(self):
+        holidays = self.cal.holidays_set(2018)
+        self.assertNotIn(date(2018, 3, 8), holidays)
+        self.assertNotIn(date(2018, 5, 8), holidays)
+
+    def test_extra_2019(self):
+        holidays = self.cal.holidays_set(2019)
+        self.assertIn(date(2019, 3, 8), holidays)
+        self.assertNotIn(date(2019, 5, 8), holidays)
+
+    def test_extra_2020(self):
+        holidays = self.cal.holidays_set(2020)
+        self.assertIn(date(2020, 3, 8), holidays)
+        self.assertIn(date(2020, 5, 8), holidays)
+
+    def test_extra_2021(self):
+        holidays = self.cal.holidays_set(2021)
+        self.assertIn(date(2021, 3, 8), holidays)
+        self.assertNotIn(date(2021, 5, 8), holidays)
+
 
 class BrandenburgTest(GenericCalendarTest):
     cal_class = Brandenburg