Consciencia negra day is not a national holiday
Added tests & changelog entry Consciencia Negra day is now specifically tested on all Brazil calendars
This commit is contained in:
parent
92db937ca8
commit
3b711f2a71
|
@ -2,7 +2,7 @@
|
|||
|
||||
## master (unreleased)
|
||||
|
||||
Nothing here yet.
|
||||
- Bugfix: setting *Consciência Negra day* as a non-holiday by default for Brazilian calendars, thx to @edniemeyer (#516).
|
||||
|
||||
## v10.1.0 (2020-06-18)
|
||||
|
||||
|
|
|
@ -579,7 +579,6 @@ class BrazilBankCalendar(Brazil):
|
|||
include_good_friday = True
|
||||
include_ash_wednesday = True
|
||||
include_corpus_christi = True
|
||||
include_consciencia_negra = False
|
||||
include_easter_sunday = False
|
||||
|
||||
def get_last_day_of_year_for_only_internal_bank_trans(self, year):
|
||||
|
|
|
@ -30,6 +30,7 @@ from ..america.brazil import IBGE_REGISTER, IBGE_TUPLE
|
|||
|
||||
class BrazilTest(GenericCalendarTest):
|
||||
cal_class = Brazil
|
||||
test_include_consciencia_negra = False
|
||||
|
||||
def test_year_2013_federal(self):
|
||||
holidays = self.cal.holidays_set(2013)
|
||||
|
@ -42,6 +43,20 @@ class BrazilTest(GenericCalendarTest):
|
|||
self.assertIn(date(2013, 11, 15), holidays) # Proclamação da República
|
||||
self.assertIn(date(2013, 12, 25), holidays) # Natal
|
||||
|
||||
def test_consciencia_negra(self):
|
||||
# Consciência Negra day is not a national holiday
|
||||
# It's triggered in the appropriate classes, so this test needs to
|
||||
# be overwritten.
|
||||
month, day = self.cal.consciencia_negra_day
|
||||
consciencia_negra_day = date(self.year, month, day)
|
||||
holidays = self.cal.holidays_set(self.year)
|
||||
if self.test_include_consciencia_negra:
|
||||
# Included where needed
|
||||
self.assertIn(consciencia_negra_day, holidays)
|
||||
else:
|
||||
# By default, not in the holidays.
|
||||
self.assertNotIn(consciencia_negra_day, holidays)
|
||||
|
||||
|
||||
class BrazilAcreTest(BrazilTest):
|
||||
cal_class = BrazilAcre
|
||||
|
@ -59,6 +74,7 @@ class BrazilAcreTest(BrazilTest):
|
|||
|
||||
class BrazilAlagoasTest(BrazilTest):
|
||||
cal_class = BrazilAlagoas
|
||||
test_include_consciencia_negra = True
|
||||
|
||||
def test_year_2017_state(self):
|
||||
holidays = self.cal.holidays_set(2017)
|
||||
|
@ -71,6 +87,7 @@ class BrazilAlagoasTest(BrazilTest):
|
|||
|
||||
class BrazilAmapaTest(BrazilTest):
|
||||
cal_class = BrazilAmapa
|
||||
test_include_consciencia_negra = True
|
||||
|
||||
def test_year_2017_state(self):
|
||||
holidays = self.cal.holidays_set(2017)
|
||||
|
@ -89,6 +106,7 @@ class BrazilAmapaTest(BrazilTest):
|
|||
|
||||
class BrazilAmazonasTest(BrazilTest):
|
||||
cal_class = BrazilAmazonas
|
||||
test_include_consciencia_negra = True
|
||||
|
||||
def test_year_2017_state(self):
|
||||
holidays = self.cal.holidays_set(2017)
|
||||
|
@ -164,6 +182,7 @@ class BrazilMinasGeraisTest(BrazilTest):
|
|||
|
||||
class BrazilMatoGrossoTest(BrazilTest):
|
||||
cal_class = BrazilMatoGrosso
|
||||
test_include_consciencia_negra = True
|
||||
|
||||
def test_year_2017_state(self):
|
||||
holidays = self.cal.holidays_set(2017)
|
||||
|
@ -226,6 +245,7 @@ class BrazilParanaTest(BrazilTest):
|
|||
|
||||
class BrazilRioDeJaneiroTest(BrazilTest):
|
||||
cal_class = BrazilRioDeJaneiro
|
||||
test_include_consciencia_negra = True
|
||||
|
||||
def test_year_2017_state(self):
|
||||
holidays = self.cal.holidays_set(2017)
|
||||
|
@ -318,6 +338,7 @@ class SaoPauloStateTest(BrazilTest):
|
|||
|
||||
class SaoPauloCityTest(SaoPauloStateTest):
|
||||
cal_class = BrazilSaoPauloCity
|
||||
test_include_consciencia_negra = True
|
||||
|
||||
def test_year_2013_city(self):
|
||||
holidays = self.cal.holidays_set(2013)
|
||||
|
@ -449,6 +470,7 @@ class BrazilGuarapariCityTest(BrazilEspiritoSantoTest):
|
|||
Guarapari city is in the Espírito Santo state
|
||||
"""
|
||||
cal_class = BrazilGuarapariCity
|
||||
test_include_consciencia_negra = True
|
||||
|
||||
def test_year_2017_city(self):
|
||||
holidays = self.cal.holidays_set(2017)
|
||||
|
|
Loading…
Reference in New Issue