File: test_usa.py

package info (click to toggle)
python-workalendar 17.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,568 kB
  • sloc: python: 16,500; makefile: 34; sh: 5
file content (1964 lines) | stat: -rw-r--r-- 78,841 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
from unittest import skip
from datetime import date
import warnings

from . import GenericCalendarTest
from ..usa import (
    UnitedStates,
    Alabama, AlabamaBaldwinCounty, AlabamaMobileCounty, AlabamaPerryCounty,
    Arkansas, Alaska, Arizona,
    # California and others
    California, CaliforniaEducation, CaliforniaBerkeley,
    CaliforniaSanFrancisco, CaliforniaWestHollywood,
    # Florida and others
    Florida, FloridaLegal, FloridaCircuitCourts, FloridaMiamiDade,
    Colorado, Connecticut, Delaware, DistrictOfColumbia, Georgia, Hawaii,
    Indiana, Illinois, Idaho, Iowa, Kansas, Kentucky, Louisiana, Maine,
    Maryland, Massachusetts, Minnesota, Michigan, Mississippi, Missouri,
    Montana, Nebraska, Nevada, NewHampshire, NewJersey, NewMexico, NewYork,
    NorthCarolina, NorthDakota, Ohio, Oklahoma, Oregon, Pennsylvania,
    RhodeIsland, SouthCarolina, SouthDakota, Tennessee, TexasBase, Texas,
    Utah, Vermont, Virginia, Washington, WestVirginia, Wisconsin, Wyoming,
    # Other territories, cities...
    AmericanSamoa, ChicagoIllinois, Guam, SuffolkCountyMassachusetts,
    FederalReserveSystem,
)


class UnitedStatesTest(GenericCalendarTest):
    cal_class = UnitedStates

    def test_martin_luther_king_day(self):
        # All States observe this day, but it started in 1985 only.
        holidays = self.cal.holidays_set(2013)
        mlk_day = self.cal.get_martin_luther_king_date(2013)
        self.assertEqual(date(2013, 1, 21), mlk_day)
        self.assertIn(mlk_day, holidays)

        holidays = self.cal.holidays_set(2014)
        mlk_day = self.cal.get_martin_luther_king_date(2014)
        self.assertEqual(date(2014, 1, 20), mlk_day)
        self.assertIn(mlk_day, holidays)

        # Shifted in 2015
        holidays = self.cal.holidays_set(2015)
        mlk_day = self.cal.get_martin_luther_king_date(2015)
        self.assertEqual(date(2015, 1, 19), mlk_day)
        self.assertIn(mlk_day, holidays)

        # Let's get into the past
        holidays = self.cal.holidays_set(1986)
        mlk_day = self.cal.get_martin_luther_king_date(1986)
        self.assertEqual(date(1986, 1, 20), mlk_day)
        self.assertIn(mlk_day, holidays)

        holidays = self.cal.holidays_set(1985)
        mlk_day = self.cal.get_martin_luther_king_date(1985)
        self.assertEqual(date(1985, 1, 21), mlk_day)
        self.assertIn(mlk_day, holidays)

        # No MLK Day before 1985
        # 3rd Monday of January was the 16th
        holidays = self.cal.holidays_set(1984)
        self.assertNotIn(date(1984, 1, 16), holidays)
        with self.assertRaises(ValueError):
            self.cal.get_martin_luther_king_date(1984)

    def test_mlk_label(self):
        _, label = self.cal.get_martin_luther_king_day(2017)
        self.assertEqual(label, "Birthday of Martin Luther King, Jr.")

    def test_federal_year_2013(self):
        holidays = self.cal.holidays_set(2013)
        self.assertIn(date(2013, 1, 1), holidays)   # New Year
        self.assertIn(date(2013, 5, 27), holidays)  # Memorial day
        self.assertIn(date(2013, 7, 4), holidays)  # Nation day
        self.assertIn(date(2013, 9, 2), holidays)  # Labour day
        self.assertIn(date(2013, 11, 11), holidays)  # Armistice
        self.assertIn(date(2013, 11, 28), holidays)  # Thanskgiving
        self.assertIn(date(2013, 12, 25), holidays)  # Christmas

    def test_presidential_year(self):
        self.assertTrue(UnitedStates.is_presidential_year(2012))
        self.assertFalse(UnitedStates.is_presidential_year(2013))
        self.assertFalse(UnitedStates.is_presidential_year(2014))
        self.assertFalse(UnitedStates.is_presidential_year(2015))
        self.assertTrue(UnitedStates.is_presidential_year(2016))

    def test_election_day(self):
        # Election day is:
        # the Tuesday next after the first Monday in the month of November
        self.assertEqual(date(2013, 11, 5), self.cal.get_election_date(2013))
        self.assertEqual(date(2014, 11, 4), self.cal.get_election_date(2014))
        self.assertEqual(date(2015, 11, 3), self.cal.get_election_date(2015))
        self.assertEqual(date(2016, 11, 8), self.cal.get_election_date(2016))
        self.assertEqual(date(2017, 11, 7), self.cal.get_election_date(2017))
        self.assertEqual(date(2018, 11, 6), self.cal.get_election_date(2018))
        self.assertEqual(date(2019, 11, 5), self.cal.get_election_date(2019))
        self.assertEqual(date(2020, 11, 3), self.cal.get_election_date(2020))

    def test_election_day_label(self):
        _, label = self.cal.get_election_day(2017)
        self.assertEqual(label, "Election Day")

    def test_federal_year_2014(self):
        holidays = self.cal.holidays_set(2014)
        self.assertIn(date(2014, 1, 1), holidays)   # New Year
        self.assertIn(date(2014, 5, 26), holidays)  # Memorial day
        self.assertIn(date(2014, 7, 4), holidays)  # Nation day
        self.assertIn(date(2014, 9, 1), holidays)  # Labour day
        self.assertIn(date(2014, 11, 11), holidays)  # Armistice
        self.assertIn(date(2014, 11, 27), holidays)  # Thanskgiving
        self.assertIn(date(2014, 12, 25), holidays)  # XMas

    def test_federal_year_2015(self):
        holidays = self.cal.holidays_set(2015)
        self.assertIn(date(2015, 1, 1), holidays)   # New Year
        self.assertIn(date(2015, 5, 25), holidays)  # Memorial day
        self.assertIn(date(2015, 7, 4), holidays)   # Nation day
        self.assertIn(date(2015, 9, 7), holidays)  # Labour day
        self.assertIn(date(2015, 11, 11), holidays)  # Armistice
        self.assertIn(date(2015, 11, 26), holidays)  # Thanskgiving
        self.assertIn(date(2015, 12, 25), holidays)  # XMas

    def test_federal_year_2017(self):
        holidays = self.cal.holidays_set(2017)
        self.assertNotIn(date(2017, 12, 27), holidays)  # XMas

    def test_columbus_day(self):
        holidays = self.cal.holidays_set(2017)
        # Columbus Day is included here
        self.assertIn(date(2017, 10, 9), holidays)

    def test_columbus_day_label(self):
        _, label = self.cal.get_columbus_day(2017)
        self.assertEqual(label, "Columbus Day")

    def test_presidential_day(self):
        # Washington's birthday, or sometimes called otherwise, may not
        # be included.
        holidays = self.cal.holidays_set(2017)
        day, _ = self.cal.get_presidents_day(2017)
        # Washington's birthday is included here
        self.assertIn(day, holidays)

    def test_president_day_label(self):
        _, label = self.cal.get_presidents_day(2017)
        self.assertEqual(label, "Washington's Birthday")

    def test_get_inauguration_date(self):
        self.assertEqual(
            date(2017, 1, 20), self.cal.get_inauguration_date(2017))
        # Not an "inauguration day" year
        with self.assertRaises(ValueError):
            self.cal.get_inauguration_date(2016)
        with self.assertRaises(ValueError):
            self.cal.get_inauguration_date(2015)
        with self.assertRaises(ValueError):
            self.cal.get_inauguration_date(2014)
        # Shifted to MON, since the 20th was on SUN
        self.assertEqual(
            date(2013, 1, 21), self.cal.get_inauguration_date(2013))
        # 2009, back to normal
        self.assertEqual(
            date(2009, 1, 20), self.cal.get_inauguration_date(2009))

    def test_inauguration_day(self):
        # NOTE: 2013 test is not relevant, it's the same day as MLK day.
        # NOTE: 1985 test is not relevant, it's the same day as MLK day.
        # By default, it's not a public holiday
        self.assertNotIn(
            self.cal.get_inauguration_date(2017),
            self.cal.holidays_set(2017)
        )
        self.assertNotIn(
            self.cal.get_inauguration_date(2009),
            self.cal.holidays_set(2009)
        )
        self.assertNotIn(
            self.cal.get_inauguration_date(1957),
            self.cal.holidays_set(1957)
        )

    def test_election_day_inclusion(self):
        # By default, election day is not included
        for year in range(2013, 2020):
            holidays = self.cal.holidays_set(year)
            self.assertNotIn(self.cal.get_election_date(year), holidays)

    def test_thanksgiving_friday(self):
        day, _ = self.cal.get_thanksgiving_friday(2017)
        self.assertEqual(day, date(2017, 11, 24))
        day, _ = self.cal.get_thanksgiving_friday(2018)
        self.assertEqual(day, date(2018, 11, 23))
        day, _ = self.cal.get_thanksgiving_friday(2019)
        self.assertEqual(day, date(2019, 11, 29))

    def test_thanksgiving_friday_label(self):
        _, label = self.cal.get_thanksgiving_friday(2017)
        self.assertEqual(label, "Thanksgiving Friday")

    def test_national_memorial_label(self):
        _, label = self.cal.get_national_memorial_day(2017)
        self.assertEqual(label, "Memorial Day")

    def test_veterans_label(self):
        _, label = self.cal.get_veterans_day(2017)
        self.assertEqual(label, "Veterans Day")

    def test_mardi_gras(self):
        year = 2017
        day = self.cal.get_fat_tuesday(year)
        holidays = self.cal.holidays_set(year)
        self.assertNotIn(day, holidays)


class NoColumbus:
    """
    Some States don't include Columbus Day:

    * Alaska
    * Arkansas
    * California
    * Delaware
    """
    def test_columbus_day(self):
        # This overrides UnitedStates.test_columbus_day
        holidays = self.cal.holidays_set(2017)
        # Columbus Day... Not included
        self.assertNotIn(date(2017, 10, 9), holidays)


class NoPresidentialDay:
    """
    Washington's birthday is not included in Delaware calendar.
    """
    def test_presidential_day(self):
        # This function *overwrites* UnitedStates.test_presidential_day
        holidays = self.cal.holidays_set(2017)
        day, _ = self.cal.get_presidents_day(2017)
        # Washington's birthday not included here
        self.assertNotIn(day, holidays)


class InaugurationDay:
    """
    When Inauguration Day is a public holiday
    """
    def test_inauguration_day(self):
        # This method overwrites UnitedStatesTest.test_inauguration_day
        self.assertIn(
            self.cal.get_inauguration_date(2017),
            self.cal.holidays_set(2017)
        )
        # NOTE: 2013 test is not relevant, it's the same as MLK Day
        self.assertIn(
            self.cal.get_inauguration_date(2009),
            self.cal.holidays_set(2009)
        )
        # NOTE: 1985 is not relevant, it's the same as MLK Day


class ElectionDayEvenYears:
    """
    Some state include the election day on even years
    """
    def test_election_day_inclusion(self):
        # This method overwrites UnitedStates.test_election_day_inclusion()
        # Election Day is a public holiday on even years.
        holidays = self.cal.holidays_set(2014)
        self.assertIn(self.cal.get_election_date(2014), holidays)
        # Odd year -- not included
        holidays = self.cal.holidays_set(2015)
        self.assertNotIn(self.cal.get_election_date(2015), holidays)
        # Even year
        holidays = self.cal.holidays_set(2016)
        self.assertIn(self.cal.get_election_date(2016), holidays)
        # Odd year -- not included
        holidays = self.cal.holidays_set(2017)
        self.assertNotIn(self.cal.get_election_date(2017), holidays)


class ElectionDayPresidentialYears:
    """
    Some state include the election day on presidential years
    """
    def test_election_day_inclusion(self):
        # This method overwrites UnitedStates.test_election_day_inclusion()
        # Election Day is a public holiday presidential years.
        # not included
        holidays = self.cal.holidays_set(2014)
        self.assertNotIn(self.cal.get_election_date(2014), holidays)
        # not included
        holidays = self.cal.holidays_set(2015)
        self.assertNotIn(self.cal.get_election_date(2015), holidays)
        # 2016 election
        holidays = self.cal.holidays_set(2016)
        self.assertIn(self.cal.get_election_date(2016), holidays)
        # not included
        holidays = self.cal.holidays_set(2017)
        self.assertNotIn(self.cal.get_election_date(2017), holidays)


class ElectionDayEveryYear:
    """
    Some State include election day on every year
    """
    def test_election_day_inclusion(self):
        # Election day is included *every year*
        for year in range(2013, 2020):
            holidays = self.cal.holidays_set(year)
            self.assertIn(self.cal.get_election_date(year), holidays)


class IncludeMardiGras:
    """
    Louisiana and some areas (Alabama Counties) include Mardi Gras
    """
    def test_mardi_gras(self):
        year = 2017
        day = self.cal.get_fat_tuesday(year)
        holidays = self.cal.holidays(year)
        holidays_dict = dict(holidays)
        self.assertIn(day, holidays_dict)
        self.assertEqual(holidays_dict[day], "Mardi Gras")


class AlabamaTest(UnitedStatesTest):
    cal_class = Alabama

    def test_mlk_label(self):
        # Overwrite UnitedStatesTest.test_mlk_label
        # Martin Luther King day is renamed in Alabama
        _, label = self.cal.get_martin_luther_king_day(2017)
        self.assertEqual(label, "Robert E. Lee/Martin Luther King Birthday")

    def test_president_day_label(self):
        # Overwrite UnitedStatesTest.test_president_day_label
        # Presidents day is renamed in Alabama
        _, label = self.cal.get_presidents_day(2017)
        self.assertEqual(label, "George Washington/Thomas Jefferson Birthday")

    def test_columbus_day_label(self):
        # Overwrite UnitedStatesTest.test_columbus_day_label
        # Columbus day is renamed in Alabama
        _, label = self.cal.get_columbus_day(2017)
        self.assertEqual(
            label,
            "Columbus Day / Fraternal Day / American Indian Heritage Day")

    def test_state_year_2014(self):
        holidays = self.cal.holidays_set(2014)
        self.assertIn(date(2014, 4, 28), holidays)  # Confederate Memorial Day
        self.assertIn(date(2014, 6, 2), holidays)  # Jefferson Davis' birthday

    def test_state_year_2015(self):
        holidays = self.cal.holidays_set(2015)
        self.assertIn(date(2015, 4, 27), holidays)  # Confederate Memorial Day
        self.assertIn(date(2015, 6, 1), holidays)  # Jefferson Davis' birthday


class AlabamaBaldwinCountyTest(IncludeMardiGras, AlabamaTest):
    cal_class = AlabamaBaldwinCounty


class AlabamaMobileCountyTest(IncludeMardiGras, AlabamaTest):
    cal_class = AlabamaMobileCounty


class AlabamaPerryCountyTest(AlabamaTest):
    cal_class = AlabamaPerryCounty

    def test_county_year_2017(self):
        holidays = self.cal.holidays_set(2017)
        self.assertIn(date(2017, 11, 13), holidays)  # Obama Day


class AlaskaTest(NoColumbus, UnitedStatesTest):
    cal_class = Alaska

    def test_state_year_2014(self):
        holidays = self.cal.holidays_set(2014)
        self.assertIn(date(2014, 3, 31), holidays)  # Seward's Day
        self.assertIn(date(2014, 10, 18), holidays)  # Alaska Day
        # Alaska Day is on SAT, shift to FRI
        self.assertIn(date(2014, 10, 17), holidays)

    def test_state_year_2015(self):
        holidays = self.cal.holidays_set(2015)
        self.assertIn(date(2015, 3, 30), holidays)  # Seward's Day
        self.assertIn(date(2015, 10, 18), holidays)  # Alaska Day
        # Alaska day is on SUN: shifted to MON
        self.assertIn(date(2015, 10, 19), holidays)

    def test_state_year_2017(self):
        holidays = self.cal.holidays_set(2017)
        self.assertIn(date(2017, 3, 27), holidays)  # Seward's Day
        self.assertIn(date(2017, 10, 18), holidays)  # Alaska Day
        # Alaska day is on WED: no shift
        self.assertNotIn(date(2017, 10, 19), holidays)
        self.assertNotIn(date(2017, 10, 17), holidays)


class ArizonaTest(UnitedStatesTest):
    cal_class = Arizona

    def test_mlk_label(self):
        # Overwrite UnitedStatesTest.test_mlk_label
        # Martin Luther King day is renamed in Arizona
        _, label = self.cal.get_martin_luther_king_day(2017)
        self.assertEqual(label, "Dr. Martin Luther King Jr./Civil Rights Day")

    def test_president_day_label(self):
        # Overwrite UnitedStatesTest.test_president_day_label
        # Presidents day is renamed in Arizona
        _, label = self.cal.get_presidents_day(2017)
        self.assertEqual(label, "Lincoln/Washington Presidents' Day")


class ArkansasTest(NoColumbus, UnitedStatesTest):
    cal_class = Arkansas

    def test_state_year_2014(self):
        holidays = self.cal.holidays_set(2014)
        self.assertIn(date(2014, 12, 24), holidays)  # XMas Eve

    def test_state_year_2015(self):
        holidays = self.cal.holidays_set(2015)
        self.assertIn(date(2015, 12, 24), holidays)  # XMas Eve

    def test_christmas_2016(self):
        holidays = self.cal.holidays_set(2016)
        self.assertIn(date(2016, 12, 24), holidays)  # XMas Eve
        self.assertIn(date(2016, 12, 23), holidays)  # XMas Eve shifted

    def test_president_day_label(self):
        # Overwrite UnitedStatesTest.test_president_day_label
        # Presidents day is renamed in Arkansas
        _, label = self.cal.get_presidents_day(2017)
        self.assertEqual(
            label,
            "George Washington's Birthday and Daisy Gatson Bates Day"
        )


class CaliforniaTest(NoColumbus, UnitedStatesTest):
    cal_class = California

    def test_state_year_2014(self):
        holidays = self.cal.holidays_set(2014)
        self.assertIn(date(2014, 3, 31), holidays)  # Cesar Chavez Day
        self.assertIn(date(2014, 11, 28), holidays)  # Thanksgiving Friday

    def test_state_year_2015(self):
        holidays = self.cal.holidays_set(2015)
        self.assertIn(date(2015, 3, 31), holidays)  # Cesar Chavez Day
        self.assertIn(date(2015, 11, 27), holidays)  # Thanksgiving Friday

    def test_state_year_2018(self):
        holidays = self.cal.holidays_set(2018)
        self.assertIn(date(2018, 3, 31), holidays)  # Cesar Chavez Day
        # Happens on SAT, but is not shifted
        self.assertNotIn(date(2018, 3, 30), holidays)
        self.assertIn(date(2018, 11, 23), holidays)  # Thanksgiving Friday

    def test_state_year_2019(self):
        holidays = self.cal.holidays_set(2019)
        self.assertIn(date(2019, 3, 31), holidays)  # Cesar Chavez Day
        self.assertIn(date(2019, 4, 1), holidays)  # Cesar Chavez Day Shift
        self.assertIn(date(2019, 11, 29), holidays)  # Thanksgiving Friday

    def test_chavez_no_duplicates(self):
        # See issue #528
        holidays = self.cal.holidays(2019)
        days = [item[0] for item in holidays]
        assert days
        for day in days:
            assert days.count(day) == 1, f"{day} is duplicated"


class CaliforniaEducationTest(CaliforniaTest):
    cal_class = CaliforniaEducation

    def test_specific_lincoln_birthday(self):
        holidays = self.cal.holidays_set(2018)
        self.assertIn(date(2018, 2, 12), holidays)  # Lincoln's Birthday

        holidays = self.cal.holidays_set(2019)
        self.assertIn(date(2019, 2, 12), holidays)  # Lincoln's Birthday

        # Lincoln's Birthday wasn't included in 2009
        holidays = self.cal.holidays_set(2009)
        self.assertNotIn(date(2009, 2, 12), holidays)

    def test_specific_native_american_day(self):
        # Native American Day occurs on the 4th MON of September
        holidays = self.cal.holidays_set(2018)
        self.assertIn(date(2018, 9, 24), holidays)  # Native American Day

        holidays = self.cal.holidays_set(2019)
        self.assertIn(date(2019, 9, 23), holidays)  # Native American Day


# Like California, except that it has:
# * No Chavez Day,
# * Includes Columbus day, but relabels it.
# * Adds Lincoln's Birthday.
class CaliforniaBerkeleyTest(UnitedStatesTest):
    cal_class = CaliforniaBerkeley

    def test_state_year_2014(self):
        # Overwriting CaliforniaTest, there's no Chavez Day for Berkeley
        holidays = self.cal.holidays_set(2014)
        self.assertNotIn(date(2014, 3, 31), holidays)  # NO Cesar Chavez Day
        self.assertIn(date(2014, 11, 28), holidays)  # Thanksgiving Friday

    def test_state_year_2015(self):
        # Overwriting CaliforniaTest, there's no Chavez Day for Berkeley
        holidays = self.cal.holidays_set(2015)
        self.assertNotIn(date(2015, 3, 31), holidays)  # NO Cesar Chavez Day
        self.assertIn(date(2015, 11, 27), holidays)  # Thanksgiving Friday

    def test_specific_lincoln_birthday(self):
        holidays = self.cal.holidays_set(2018)
        self.assertIn(date(2018, 2, 12), holidays)  # Lincoln's Birthday

        holidays = self.cal.holidays_set(2019)
        self.assertIn(date(2019, 2, 12), holidays)  # Lincoln's Birthday

    def test_specific_malcomx_birthday(self):
        holidays = self.cal.holidays_set(2018)
        self.assertIn(date(2018, 5, 19), holidays)  # Malcom X Day

        holidays = self.cal.holidays_set(2019)
        self.assertIn(date(2019, 5, 19), holidays)  # Malcom X Day

    def test_columbus_day_label(self):
        # Overwrite UnitedStatesTest.test_columbus_day_label
        _, label = self.cal.get_columbus_day(2019)
        self.assertEqual(label, "Indigenous People's Day")


# Like California, except:
# * No Chavez Day,
# * Added Columbus Day
class CaliforniaSanFranciscoTest(UnitedStatesTest):
    cal_class = CaliforniaSanFrancisco

    def test_state_year_2014(self):
        holidays = self.cal.holidays_set(2014)
        self.assertNotIn(date(2014, 3, 31), holidays)  # NO Cesar Chavez Day
        self.assertIn(date(2014, 11, 28), holidays)  # Thanksgiving Friday

    def test_state_year_2015(self):
        holidays = self.cal.holidays_set(2015)
        self.assertNotIn(date(2015, 3, 31), holidays)  # NO Cesar Chavez Day
        self.assertIn(date(2015, 11, 27), holidays)  # Thanksgiving Friday


# Like California, except:
# * No Chavez Day,
# * No Thanksgiving Friday
# * Added Harvey Milk Day
class CaliforniaWestHollywoodTest(NoColumbus, UnitedStatesTest):
    cal_class = CaliforniaWestHollywood

    def test_state_year_2014(self):
        holidays = self.cal.holidays_set(2014)
        self.assertNotIn(date(2014, 3, 31), holidays)  # NO Cesar Chavez Day
        self.assertNotIn(date(2014, 11, 28), holidays)  # Thanksgiving Friday

    def test_state_year_2015(self):
        holidays = self.cal.holidays_set(2015)
        self.assertNotIn(date(2015, 3, 31), holidays)  # NO Cesar Chavez Day
        self.assertNotIn(date(2015, 11, 27), holidays)  # Thanksgiving Friday

    def test_harvey_milk_day(self):
        holidays = self.cal.holidays_set(2018)
        self.assertIn(date(2018, 5, 22), holidays)  # Harvey Milk Day

        holidays = self.cal.holidays_set(2019)
        self.assertIn(date(2019, 5, 22), holidays)  # Harvey Milk Day


class ColoradoTest(UnitedStatesTest):
    cal_class = Colorado
    # Colorado has only federal state holidays.
    # NOTE: Cesar Chavez Day is an optional holiday


class ConnecticutTest(UnitedStatesTest):
    cal_class = Connecticut

    def test_state_year_2014(self):
        holidays = self.cal.holidays_set(2014)
        self.assertIn(date(2014, 2, 12), holidays)  # Lincoln's Birthday
        self.assertIn(date(2014, 4, 18), holidays)  # Good Friday

    def test_state_year_2015(self):
        holidays = self.cal.holidays_set(2015)
        self.assertIn(date(2015, 2, 12), holidays)  # Lincoln's Birthday
        self.assertIn(date(2015, 4, 3), holidays)  # Good Friday


class DelawareTest(ElectionDayEvenYears, NoPresidentialDay, NoColumbus,
                   UnitedStatesTest):
    cal_class = Delaware

    def test_state_year_2014(self):
        holidays = self.cal.holidays_set(2014)
        self.assertIn(date(2014, 4, 18), holidays)  # Good Friday
        self.assertIn(date(2014, 11, 28), holidays)  # Thanksgiving Friday

    def test_state_year_2015(self):
        holidays = self.cal.holidays_set(2015)
        self.assertIn(date(2015, 4, 3), holidays)  # Good Friday
        self.assertIn(date(2015, 11, 27), holidays)  # Thanksgiving Friday


class DistrictOfColumbiaTest(InaugurationDay, UnitedStatesTest):
    cal_class = DistrictOfColumbia

    def test_state_year_2017(self):
        # President elected in 2016, Inauguration Day is year+1
        holidays = self.cal.holidays_set(2017)
        self.assertIn(date(2017, 1, 20), holidays)  # Inauguration Day
        self.assertIn(date(2017, 4, 16), holidays)  # Emancipation Day

    def test_state_year_2016(self):
        holidays = self.cal.holidays_set(2016)
        # No Inauguration Day the other years
        self.assertNotIn(date(2016, 1, 20), holidays)
        self.assertIn(date(2016, 4, 16), holidays)  # Emancipation Day


class FloridaBasicTest:
    """
    Core Florida tests.

    The difference is that it includes the Thanksgiving Friday *and* its label
    is renamed.
    """
    def test_state_year_2014(self):
        holidays = self.cal.holidays_set(2014)
        self.assertIn(date(2014, 11, 28), holidays)  # Thanksgiving Friday

    def test_state_year_2015(self):
        holidays = self.cal.holidays_set(2015)
        self.assertIn(date(2015, 7, 3), holidays)
        self.assertIn(date(2015, 11, 27), holidays)  # Thanksgiving Friday

    def test_thanksgiving_friday_label(self):
        # Overwrite UnitedStatesTest.test_thanksgiving_friday_label
        _, label = self.cal.get_thanksgiving_friday(2017)
        self.assertEqual(label, "Friday after Thanksgiving")


class FloridaTest(NoColumbus, NoPresidentialDay, FloridaBasicTest,
                  UnitedStatesTest):
    """
    Florida includes all federal holidays except
    Washington's Birthday & Columbus day
    """
    cal_class = Florida


class FloridaLegalTest(IncludeMardiGras, ElectionDayEveryYear,
                       FloridaBasicTest, UnitedStatesTest):
    """
    Florida Legal Holidays include:

    * All Florida State Holidays,
    * Mardi Gras,
    * Lincoln's Birthday,
    * Susan B. Anthony Day,
    * Washington's Birthday,
    * Good Friday,
    * Pascua Florida Day,
    * Confederate Memorial Day,
    * Jefferson Davies Birthday,
    * Flag Day
    * Columbus Day renamed as "Columbus and Farmers' Day"
    * Election Day
    """
    cal_class = FloridaLegal

    def test_init_warning(self):
        warnings.simplefilter("always")
        with warnings.catch_warnings(record=True) as w:
            # Cause all warnings to always be triggered.
            # Trigger a warning.
            self.cal_class()
            # Verify some things
            assert len(w) == 1
            assert issubclass(w[-1].category, UserWarning)
            assert "Florida's laws separate the definitions between paid versus legal holidays." in str(w[-1].message)  # noqa
        warnings.simplefilter("ignore")

    def test_specific_lincoln_birthday(self):
        holidays = self.cal.holidays_set(2014)
        self.assertIn(date(2014, 2, 12), holidays)  # Lincoln's Birthday

        holidays = self.cal.holidays_set(2015)
        self.assertIn(date(2015, 2, 12), holidays)  # Lincoln's Birthday

    def test_susan_b_anthony_day(self):
        holidays = self.cal.holidays_set(2019)
        self.assertIn(date(2019, 2, 15), holidays)  # Susan B. Anthony Day

    def test_good_friday(self):
        holidays = self.cal.holidays_set(2014)
        self.assertIn(date(2014, 4, 18), holidays)  # Good Friday
        holidays = self.cal.holidays_set(2015)
        self.assertIn(date(2015, 4, 3), holidays)  # Good Friday

    def test_pascua_florida_day(self):
        holidays = self.cal.holidays_set(2019)
        self.assertIn(date(2019, 4, 2), holidays)  # Pascua Florida Day

    def test_confederate_holidays(self):
        holidays = self.cal.holidays_set(2014)
        self.assertIn(date(2014, 4, 26), holidays)  # Confederate Memorial Day
        self.assertIn(date(2014, 6, 3), holidays)  # Jefferson Davis' birthday

        holidays = self.cal.holidays_set(2015)
        self.assertIn(date(2015, 4, 26), holidays)  # Confederate Memorial Day
        self.assertIn(date(2015, 6, 3), holidays)  # Jefferson Davis' birthday

        holidays = self.cal.holidays_set(2018)
        self.assertIn(date(2018, 4, 26), holidays)  # Confederate Memorial Day
        self.assertIn(date(2018, 6, 3), holidays)  # Jefferson Davis' birthday

    def test_flag_day(self):
        holidays = self.cal.holidays_set(2018)
        self.assertIn(date(2018, 6, 14), holidays)  # Flag Day

        holidays = self.cal.holidays_set(2019)
        self.assertIn(date(2019, 6, 14), holidays)  # Flag Day

    def test_columbus_day_label(self):
        _, label = self.cal.get_columbus_day(2017)
        self.assertEqual(label, "Columbus Day and Farmers' Day")


class FloridaCircuitCourtsTest(NoColumbus, FloridaBasicTest, UnitedStatesTest):
    cal_class = FloridaCircuitCourts

    def test_good_friday(self):
        holidays = self.cal.holidays_set(2014)
        self.assertIn(date(2014, 4, 18), holidays)  # Good Friday
        holidays = self.cal.holidays_set(2015)
        self.assertIn(date(2015, 4, 3), holidays)  # Good Friday

    def test_rosh_hashanah_2018(self):
        # src: https://www.firstjudicialcircuit.org/about-court/court-holidays
        rosh_hashanah = self.cal.get_rosh_hashanah(2018)
        self.assertEqual(rosh_hashanah, date(2018, 9, 10))
        holidays = self.cal.holidays_set(2018)
        self.assertIn(rosh_hashanah, holidays)

    def test_rosh_hashanah_2019(self):
        # src: https://www.firstjudicialcircuit.org/about-court/court-holidays
        rosh_hashanah = self.cal.get_rosh_hashanah(2019)
        self.assertEqual(rosh_hashanah, date(2019, 9, 30))
        holidays = self.cal.holidays_set(2019)
        self.assertIn(rosh_hashanah, holidays)

    def test_yom_kippur_2018(self):
        # src: https://www.firstjudicialcircuit.org/about-court/court-holidays
        yom_kippur = self.cal.get_yom_kippur(2018)
        self.assertEqual(yom_kippur, date(2018, 9, 19))
        holidays = self.cal.holidays_set(2018)
        self.assertIn(yom_kippur, holidays)

    def test_yom_kippur_2019(self):
        # src: https://www.firstjudicialcircuit.org/about-court/court-holidays
        yom_kippur = self.cal.get_yom_kippur(2019)
        self.assertEqual(yom_kippur, date(2019, 10, 9))
        holidays = self.cal.holidays_set(2019)
        self.assertIn(yom_kippur, holidays)


class FloridaMiamiDadeTests(FloridaBasicTest, UnitedStatesTest):
    cal_class = FloridaMiamiDade


class GeorgiaTest(NoPresidentialDay, UnitedStatesTest):
    cal_class = Georgia

    def test_state_year_2014(self):
        holidays = self.cal.holidays_set(2014)
        self.assertIn(date(2014, 4, 28), holidays)  # Confederate Memorial
        self.assertIn(date(2014, 12, 26), holidays)  # Washington bday

    def test_state_year_2015(self):
        holidays = self.cal.holidays_set(2015)
        self.assertIn(date(2015, 4, 27), holidays)  # Confederate Memorial
        self.assertIn(date(2015, 12, 24), holidays)  # Washington bday

    def test_washington_birthday(self):
        # Sources:
        # * https://georgia.gov/popular-topic/observing-state-holidays
        # * https://georgia.gov/popular-topic/state-holidays
        day, _ = self.cal.get_washington_birthday_december(2020)
        self.assertEqual(day, date(2020, 12, 24))

        day, _ = self.cal.get_washington_birthday_december(2019)
        self.assertEqual(day, date(2019, 12, 24))

        day, _ = self.cal.get_washington_birthday_december(2018)
        self.assertEqual(day, date(2018, 12, 24))

        day, _ = self.cal.get_washington_birthday_december(2017)
        self.assertEqual(day, date(2017, 12, 26))

        day, _ = self.cal.get_washington_birthday_december(2016)
        self.assertEqual(day, date(2016, 12, 27))

        day, _ = self.cal.get_washington_birthday_december(2015)
        self.assertEqual(day, date(2015, 12, 24))

        day, _ = self.cal.get_washington_birthday_december(2014)
        self.assertEqual(day, date(2014, 12, 26))

        day, _ = self.cal.get_washington_birthday_december(2013)
        self.assertEqual(day, date(2013, 12, 24))

        day, _ = self.cal.get_washington_birthday_december(2012)
        self.assertEqual(day, date(2012, 12, 24))

        # Source:
        # https://web.archive.org/web/20110927122533/http://www.georgia.gov/00/channel_modifieddate/0,2096,4802_64437763,00.html  # noqa
        day, _ = self.cal.get_washington_birthday_december(2011)
        self.assertEqual(day, date(2011, 12, 26))

        # Source:
        # https://web.archive.org/web/20100304032739/http://www.georgia.gov/00/channel_modifieddate/0,2096,4802_64437763,00.html  # noqa
        day, _ = self.cal.get_washington_birthday_december(2010)
        self.assertEqual(day, date(2010, 12, 23))

    def test_year_2019(self):
        holidays = self.cal.holidays_set(2019)
        self.assertIn(date(2019, 1, 1), holidays)   # New Year
        self.assertIn(date(2019, 1, 21), holidays)  # MLK
        self.assertIn(date(2019, 4, 22), holidays)  # state holiday
        self.assertIn(date(2019, 5, 27), holidays)  # memorial day
        self.assertIn(date(2019, 7, 4), holidays)  # Independance day
        self.assertIn(date(2019, 9, 2), holidays)  # Labor day
        self.assertIn(date(2019, 10, 14), holidays)  # Columbus
        self.assertIn(date(2019, 11, 11), holidays)  # Veterans
        self.assertIn(date(2019, 11, 28), holidays)  # Thanksgiving
        self.assertIn(date(2019, 11, 29), holidays)  # State Holiday
        # Washington's Birthday switched to XMAS eve
        self.assertIn(date(2019, 12, 24), holidays)
        self.assertIn(date(2019, 12, 25), holidays)  # XMAS

    def test_year_2020(self):
        holidays = self.cal.holidays_set(2020)
        self.assertIn(date(2020, 1, 1), holidays)   # New Year
        self.assertIn(date(2020, 1, 20), holidays)  # MLK

        # State holiday special case
        # Confederate memorial day has been shifted to April 10th.
        # Reason is unknown, so we're adding a single exception in the
        # `get_confederate_day`
        self.assertNotIn(date(2020, 4, 26), holidays)
        self.assertIn(date(2020, 4, 10), holidays)

        self.assertIn(date(2020, 5, 25), holidays)  # memorial day
        self.assertIn(date(2020, 7, 3), holidays)  # Independance day (OBS)
        self.assertIn(date(2020, 7, 4), holidays)  # Independance day
        self.assertIn(date(2020, 9, 7), holidays)  # Labor day
        self.assertIn(date(2020, 10, 12), holidays)  # Columbus
        self.assertIn(date(2020, 11, 11), holidays)  # Veterans
        self.assertIn(date(2020, 11, 26), holidays)  # Thanksgiving
        self.assertIn(date(2020, 11, 27), holidays)  # State Holiday
        self.assertIn(date(2020, 12, 24), holidays)  # Washington B'day
        self.assertIn(date(2020, 12, 25), holidays)  # XMAS

    def test_thanksgiving_friday_label(self):
        # Overwrite UnitedStatesTest.test_thanksgiving_friday_label

        # Until 2016, the 4th FRI of november was labelled
        # "Robert E. Lee's Birthday (Observed)"
        for year in (2013, 2014, 2015,):
            _, label = self.cal.get_robert_lee_birthday(year)
            self.assertEqual(label, "Robert E. Lee's Birthday (Observed)")

        for year in (2016, 2017, 2018, 2019, 2020):
            _, label = self.cal.get_robert_lee_birthday(year)
            self.assertEqual(label, "State Holiday")

    def test_get_confederate_day_label(self):
        # Until 2016, it was labelled "Confederate Memorial Day"
        for year in (2013, 2014, 2015,):
            _, label = self.cal.get_confederate_day(year)
            self.assertEqual(label, "Confederate Memorial Day")

        for year in (2016, 2017, 2018, 2019, 2020):
            _, label = self.cal.get_confederate_day(year)
            self.assertEqual(label, "State Holiday")


class HawaiiTest(ElectionDayEvenYears, NoColumbus, UnitedStatesTest):
    cal_class = Hawaii

    def test_state_year_2017(self):
        holidays = self.cal.holidays_set(2017)
        self.assertIn(date(2017, 3, 26),
                      holidays)  # Prince Jonah Kuhio Kalanianaole
        self.assertIn(date(2017, 3, 27),
                      holidays)  # Prince Jonah Kuhio Kalanianaole (shifted)
        self.assertIn(date(2017, 4, 14), holidays)  # Good Friday
        self.assertIn(date(2017, 6, 11), holidays)  # Kamehameha
        self.assertIn(date(2017, 6, 12), holidays)  # Kamehameha (shifted)
        self.assertIn(date(2017, 8, 18), holidays)  # Statehood day

    def test_state_year_2018(self):
        holidays = self.cal.holidays_set(2018)
        self.assertIn(date(2018, 3, 26),
                      holidays)  # Prince Jonah Kuhio Kalanianaole

        self.assertIn(date(2018, 3, 30), holidays)  # Good Friday
        self.assertIn(date(2018, 6, 11), holidays)  # Kamehameha
        self.assertIn(date(2018, 8, 17), holidays)  # Statehood day

        # Prince Jonah Kuhio Kalanianaole is not shifted
        self.assertNotIn(date(2018, 3, 27), holidays)
        # Kamehameha is not shifted
        self.assertNotIn(date(2018, 6, 12), holidays)


class IdahoTest(UnitedStatesTest):
    cal_class = Idaho
    # NOTE: Idaho only has federal holidays.

    def test_mlk_label(self):
        # Overwrite UnitedStatesTest.test_mlk_label
        # Martin Luther King day is renamed in Idaho
        _, label = self.cal.get_martin_luther_king_day(2017)
        self.assertEqual(
            label, "Martin Luther King Jr. / Idaho Human Rights Day")


class IllinoisTest(ElectionDayEvenYears, UnitedStatesTest):
    cal_class = Illinois

    def test_state_year_2014(self):
        holidays = self.cal.holidays_set(2014)
        self.assertIn(date(2014, 2, 12), holidays)  # Lincoln's Birthday
        self.assertIn(date(2014, 11, 28), holidays)  # Thanksgiving Friday

    def test_state_year_2015(self):
        holidays = self.cal.holidays_set(2015)
        self.assertIn(date(2015, 2, 12), holidays)  # Lincoln's Birthday
        self.assertIn(date(2015, 11, 27), holidays)  # Thanksgiving Friday


class ChicagoIllinoisTest(ElectionDayEvenYears, UnitedStatesTest):
    cal_class = ChicagoIllinois

    def test_state_year_2014(self):
        holidays = self.cal.holidays_set(2014)
        self.assertIn(date(2014, 2, 12), holidays)  # Lincoln's Birthday
        # Thanksgiving Friday is NOT a holiday in Chicago.
        self.assertNotIn(date(2014, 11, 28), holidays)

    def test_state_year_2015(self):
        holidays = self.cal.holidays_set(2015)
        self.assertIn(date(2015, 2, 12), holidays)  # Lincoln's Birthday
        # Thanksgiving Friday is NOT a holiday in Chicago.
        self.assertNotIn(date(2015, 11, 27), holidays)

    def test_pulaski_day(self):
        # Pulaski day is on the first MON in March.
        # Source: https://en.wikipedia.org/wiki/Casimir_Pulaski_Day
        holidays = self.cal.holidays_set(2018)
        self.assertIn(date(2018, 3, 5), holidays)
        holidays = self.cal.holidays_set(2019)
        self.assertIn(date(2019, 3, 4), holidays)
        holidays = self.cal.holidays_set(2020)
        self.assertIn(date(2020, 3, 2), holidays)
        holidays = self.cal.holidays_set(2021)
        self.assertIn(date(2021, 3, 1), holidays)


class IndianaTest(ElectionDayEvenYears, NoPresidentialDay, UnitedStatesTest):
    cal_class = Indiana

    def test_state_year_2014(self):
        holidays = self.cal.holidays_set(2014)
        self.assertIn(date(2014, 4, 18), holidays)  # Good Friday
        # Thanksgiving Friday -- Renamed into Lincoln's Birthday
        self.assertIn(date(2014, 11, 28), holidays)
        # FIXME: this holiday rule is Confusing, probably false
        self.assertIn(date(2014, 12, 26), holidays)  # Washington bday

        # Primary Election Day, only happen on even years
        self.assertIn(date(2014, 5, 6), holidays)

    def test_state_year_2015(self):
        holidays = self.cal.holidays_set(2015)
        self.assertIn(date(2015, 4, 3), holidays)  # Good Friday
        # Thanksgiving Friday -- Renamed into Lincoln's Birthday
        self.assertIn(date(2015, 11, 27), holidays)
        # FIXME: this holiday rule is Confusing, probably false
        self.assertIn(date(2015, 12, 24), holidays)  # Washington bday

        # Primary Election Day, only happen on even years
        self.assertNotIn(date(2015, 5, 5), holidays)

    def test_primary_election_day(self):
        # Source:
        # -> https://www.timeanddate.com/holidays/us/primary-election-indiana
        # Year 2010
        election_day, _ = self.cal.get_primary_election_day(2010)
        self.assertEqual(election_day, date(2010, 5, 4))
        # Year 2012
        election_day, _ = self.cal.get_primary_election_day(2012)
        self.assertEqual(election_day, date(2012, 5, 8))
        # Year 2014
        election_day, _ = self.cal.get_primary_election_day(2014)
        self.assertEqual(election_day, date(2014, 5, 6))
        # Year 2016
        election_day, _ = self.cal.get_primary_election_day(2016)
        self.assertEqual(election_day, date(2016, 5, 3))

    def test_election_day_label(self):
        # Overwrite UnitedStatesTest.test_election_day_label
        # Election Day is "General Election Day" in Indiana
        _, label = self.cal.get_election_day(2017)
        self.assertEqual(label, "General Election Day")

    def test_thanksgiving_friday_label(self):
        # Overwrite UnitedStatesTest.test_thanksgiving_friday_label
        # Lincoln's Birthday is set on Thanksgiving Friday
        _, label = self.cal.get_thanksgiving_friday(2017)
        self.assertEqual(label, "Lincoln's Birthday")

    @skip("Confusing Rule, it's impossible to decide")
    def test_washington_birthday(self):
        # Sources:
        # http://www.in.gov/spd/files/2018_Holidays.pdf
        # http://www.in.gov/spd/files/2017_Holidays.pdf
        # http://www.in.gov/spd/files/2016_Holidays.pdf

        # Year 2016, shifted to the 26th
        washington_bday = self.cal.get_washington_birthday_december(2016)
        self.assertEqual(date(2016, 12, 26), washington_bday)

        # Year 2017, shifted to the 26th
        washington_bday = self.cal.get_washington_birthday_december(2017)
        self.assertEqual(date(2017, 12, 26), washington_bday)

        # Year 2018, back to XMas Eve
        washington_bday = self.cal.get_washington_birthday_december(2018)
        self.assertEqual(date(2018, 12, 24), washington_bday)


class IowaTest(NoPresidentialDay, NoColumbus, UnitedStatesTest):
    cal_class = Iowa

    def test_state_year_2014(self):
        holidays = self.cal.holidays_set(2014)
        self.assertIn(date(2014, 11, 28), holidays)  # Thanksgiving Friday

    def test_state_year_2015(self):
        holidays = self.cal.holidays_set(2015)
        self.assertIn(date(2015, 7, 3), holidays)
        self.assertIn(date(2015, 11, 27), holidays)  # Thanksgiving Friday


class KansasTest(NoPresidentialDay, NoColumbus, UnitedStatesTest):
    cal_class = Kansas


class KentuckyTest(NoPresidentialDay, NoColumbus, UnitedStatesTest):
    cal_class = Kentucky

    def test_state_year_2014(self):
        holidays = self.cal.holidays_set(2014)
        self.assertIn(date(2014, 4, 18), holidays)  # Good Friday
        self.assertIn(date(2014, 11, 28), holidays)  # Thanksgiving Friday
        self.assertIn(date(2014, 12, 24), holidays)  # XMas Eve
        self.assertIn(date(2014, 12, 31), holidays)  # NY Eve

    def test_state_year_2015(self):
        holidays = self.cal.holidays_set(2015)
        self.assertIn(date(2015, 4, 3), holidays)  # Good Friday
        self.assertIn(date(2015, 11, 27), holidays)  # Thanksgiving Friday
        self.assertIn(date(2015, 12, 24), holidays)  # XMas Eve
        self.assertIn(date(2015, 12, 31), holidays)  # NY Eve


class LouisianaTest(IncludeMardiGras, NoColumbus, ElectionDayEvenYears,
                    UnitedStatesTest):
    cal_class = Louisiana

    def test_state_year_2014(self):
        holidays = self.cal.holidays_set(2014)
        self.assertIn(date(2014, 4, 18), holidays)  # Good Friday

    def test_state_year_2015(self):
        holidays = self.cal.holidays_set(2015)
        self.assertIn(date(2015, 4, 3), holidays)  # Good Friday


class MaineTest(UnitedStatesTest):
    cal_class = Maine

    def test_state_year_2014(self):
        holidays = self.cal.holidays_set(2014)
        self.assertIn(date(2014, 4, 21), holidays)   # Patriot's day
        self.assertIn(date(2014, 11, 28), holidays)  # Thanksgiving Friday

    def test_state_year_2015(self):
        holidays = self.cal.holidays_set(2015)
        self.assertIn(date(2015, 4, 20), holidays)   # Patriot's day
        self.assertIn(date(2015, 11, 27), holidays)  # Thanksgiving Friday


class MarylandTest(ElectionDayPresidentialYears, UnitedStatesTest):
    cal_class = Maryland

    def test_state_year_2014(self):
        holidays = self.cal.holidays_set(2014)
        # Thanksgiving Friday == Native American Heritage Day
        self.assertIn(date(2014, 11, 28), holidays)

    def test_state_year_2015(self):
        holidays = self.cal.holidays_set(2015)
        # Thanksgiving Friday == Native American Heritage Day
        self.assertIn(date(2015, 11, 27), holidays)

    def test_thanksgiving_friday_label(self):
        # Overwrite UnitedStatesTest.test_thanksgiving_friday_label
        # Thanksgiving Friday label changed to "Native American Heritage Day"
        _, label = self.cal.get_thanksgiving_friday(2017)
        self.assertEqual(label, "Native American Heritage Day")


class MassachusettsTest(UnitedStatesTest):
    cal_class = Massachusetts

    def test_state_year_2014(self):
        holidays = self.cal.holidays_set(2014)
        self.assertIn(date(2014, 4, 21), holidays)  # Patriot's day

    def test_state_year_2015(self):
        holidays = self.cal.holidays_set(2015)
        self.assertIn(date(2015, 4, 20), holidays)  # Patriot's day


class SuffolkCountyMassachusettsTest(MassachusettsTest):
    cal_class = SuffolkCountyMassachusetts

    def test_county_year_2018(self):
        holidays = self.cal.holidays_set(2018)
        self.assertIn(date(2018, 3, 17), holidays)  # Evacuation Day
        self.assertIn(date(2018, 6, 17), holidays)  # Bunker Hill Day

    def test_county_year_2019(self):
        holidays = self.cal.holidays_set(2019)
        self.assertIn(date(2019, 3, 17), holidays)  # Evacuation Day
        self.assertIn(date(2019, 6, 17), holidays)  # Bunker Hill Day


class MichiganTest(NoColumbus, ElectionDayEvenYears, UnitedStatesTest):
    cal_class = Michigan

    def test_state_year_2014(self):
        holidays = self.cal.holidays_set(2014)
        self.assertIn(date(2014, 11, 28), holidays)  # Thanksgiving Friday
        self.assertIn(date(2014, 12, 24), holidays)  # XMas Eve
        self.assertIn(date(2014, 12, 31), holidays)  # New Years Eve

    def test_state_year_2015(self):
        holidays = self.cal.holidays_set(2015)
        self.assertIn(date(2015, 11, 27), holidays)  # Thanksgiving Friday
        self.assertIn(date(2015, 12, 24), holidays)  # XMas Eve
        self.assertIn(date(2015, 12, 31), holidays)  # New Years Eve

    def test_state_year_2017(self):
        holidays = self.cal.holidays_set(2017)
        self.assertIn(date(2017, 11, 24), holidays)  # Thanksgiving Friday

        # XMas Eve
        self.assertIn(date(2017, 12, 24), holidays)
        # XMAs Eve is on SUN, shifted to Dec, 22nd
        self.assertIn(date(2017, 12, 22), holidays)

        # New Years Eve
        self.assertIn(date(2017, 12, 31), holidays)
        # New Years Eve is on SUN, shifted to Dec, 29nd
        self.assertIn(date(2017, 12, 29), holidays)


class MinnesotaTest(NoColumbus, UnitedStatesTest):
    cal_class = Minnesota

    def test_state_year_2014(self):
        holidays = self.cal.holidays_set(2014)
        self.assertIn(date(2014, 11, 28), holidays)  # Thanksgiving Friday

    def test_state_year_2015(self):
        holidays = self.cal.holidays_set(2015)
        self.assertIn(date(2015, 11, 27), holidays)  # Thanksgiving Friday


class MississippiTest(NoColumbus, UnitedStatesTest):
    cal_class = Mississippi

    def test_state_year_2014(self):
        holidays = self.cal.holidays_set(2014)
        self.assertIn(date(2014, 4, 28), holidays)  # Confederate Memorial Day
        self.assertIn(date(2014, 11, 28), holidays)  # Thanksgiving Friday

    def test_state_year_2015(self):
        holidays = self.cal.holidays_set(2015)
        self.assertIn(date(2015, 4, 27), holidays)  # Confederate Memorial Day
        self.assertIn(date(2015, 11, 27), holidays)  # Thanksgiving Friday

    def test_mlk_label(self):
        # Overwrite UnitedStatesTest.test_mlk_label
        # Martin Luther King day is renamed in Mississippi
        _, label = self.cal.get_martin_luther_king_day(2017)
        self.assertEqual(
            label, "Martin Luther King's and Robert E. Lee's Birthdays")

    def test_national_memorial_label(self):
        # Overwrite UnitedStatesTest.test_national_memorial_label
        # National Memorial Day is renamed in Mississippi
        _, label = self.cal.get_national_memorial_day(2017)
        self.assertEqual(
            label, "National Memorial Day / Jefferson Davis Birthday")

    def test_veterans_label(self):
        # Overwrite UnitedStatesTest.test_veterans_label
        # Veterans Day is renamed in Mississippi
        _, label = self.cal.get_veterans_day(2017)
        self.assertEqual(label, "Armistice Day (Veterans Day)")


class MissouriTest(UnitedStatesTest):
    cal_class = Missouri

    def test_state_year_2014(self):
        holidays = self.cal.holidays_set(2014)
        self.assertIn(date(2014, 2, 12), holidays)  # Lincoln's Birthday
        self.assertIn(date(2014, 5, 8), holidays)   # Truman Day

    def test_state_year_2015(self):
        holidays = self.cal.holidays_set(2015)
        self.assertIn(date(2015, 2, 12), holidays)  # Lincoln's Birthday
        self.assertIn(date(2015, 5, 8), holidays)   # Truman Day


class MontanaTest(ElectionDayEvenYears, UnitedStatesTest):
    cal_class = Montana
    # NOTE: Montana include only Federal Holidays + General Election Day


class NebraskaTest(UnitedStatesTest):
    cal_class = Nebraska

    def test_state_year_2014(self):
        holidays = self.cal.holidays_set(2014)
        self.assertIn(date(2014, 4, 25), holidays)  # Arbor Day
        self.assertIn(date(2014, 11, 28), holidays)  # Thanksgiving Friday

    def test_state_year_2015(self):
        holidays = self.cal.holidays_set(2015)
        self.assertIn(date(2015, 4, 24), holidays)  # Arbor Day
        self.assertIn(date(2015, 11, 27), holidays)  # Thanksgiving Friday


class NevadaTest(NoColumbus, UnitedStatesTest):
    cal_class = Nevada

    def test_state_year_2014(self):
        holidays = self.cal.holidays_set(2014)
        self.assertIn(date(2014, 10, 31), holidays)  # Nevada Day
        self.assertIn(date(2014, 11, 28), holidays)  # Thanksgiving Friday

    def test_state_year_2015(self):
        holidays = self.cal.holidays_set(2015)
        self.assertIn(date(2015, 10, 30), holidays)  # Nevada Day
        self.assertIn(date(2015, 11, 27), holidays)  # Thanksgiving Friday

    def test_thanksgiving_friday_label(self):
        # Overwrite UnitedStatesTest.test_thanksgiving_friday_label
        # Thanksgiving Friday Label is Family Day in Nevada
        _, label = self.cal.get_thanksgiving_friday(2017)
        self.assertEqual(label, "Family Day")


class NewHampshireTest(UnitedStatesTest):
    cal_class = NewHampshire

    def test_state_year_2014(self):
        holidays = self.cal.holidays_set(2014)
        self.assertIn(date(2014, 11, 28), holidays)  # Thanksgiving Friday

    def test_state_year_2015(self):
        holidays = self.cal.holidays_set(2015)
        self.assertIn(date(2015, 11, 27), holidays)  # Thanksgiving Friday

    def test_mlk_label(self):
        # Overwrite UnitedStatesTest.test_mlk_label
        # Martin Luther King day is renamed in New Hampshire
        _, label = self.cal.get_martin_luther_king_day(2017)
        self.assertEqual(label, "Martin Luther King, Jr. Civil Rights Day")


class NewJerseyTest(ElectionDayEveryYear, UnitedStatesTest):
    cal_class = NewJersey

    def test_state_year_2014(self):
        holidays = self.cal.holidays_set(2014)
        self.assertIn(date(2014, 4, 18), holidays)  # Good Friday

    def test_state_year_2015(self):
        holidays = self.cal.holidays_set(2015)
        self.assertIn(date(2015, 4, 3), holidays)  # Good Friday


class NewMexicoTest(NoPresidentialDay, UnitedStatesTest):
    cal_class = NewMexico

    def test_state_year_2014(self):
        holidays = self.cal.holidays_set(2014)
        self.assertIn(date(2014, 11, 28), holidays)  # Thanksgiving Friday

    def test_state_year_2015(self):
        holidays = self.cal.holidays_set(2015)
        self.assertIn(date(2015, 11, 27), holidays)  # Thanksgiving Friday

    def test_thanksgiving_friday_label(self):
        # Overwrite UnitedStatesTest.test_thanksgiving_friday_label
        # New Mexico is celebrating Presidents' Day on Thanksgiving Friday
        _, label = self.cal.get_thanksgiving_friday(2017)
        self.assertEqual(label, "Presidents' Day")


class NewYorkTest(ElectionDayEveryYear, UnitedStatesTest):
    cal_class = NewYork

    def test_state_year_2014(self):
        holidays = self.cal.holidays_set(2014)
        self.assertIn(date(2014, 2, 12), holidays)  # Lincoln's Birthday

    def test_state_year_2015(self):
        holidays = self.cal.holidays_set(2015)
        self.assertIn(date(2015, 2, 12), holidays)  # Lincoln's Birthday


class NorthCarolinaTest(NoPresidentialDay, NoColumbus, UnitedStatesTest):
    cal_class = NorthCarolina

    def test_state_year_2014(self):
        holidays = self.cal.holidays_set(2014)
        self.assertIn(date(2014, 4, 18), holidays)  # Good Friday
        self.assertIn(date(2014, 11, 27), holidays)  # Thanksgiving Thursday
        self.assertIn(date(2014, 11, 28), holidays)  # Thanksgiving Friday
        self.assertIn(date(2014, 12, 24), holidays)  # XMas Eve
        self.assertIn(date(2014, 12, 26), holidays)  # Boxing Day

    def test_state_year_2015(self):
        holidays = self.cal.holidays_set(2015)
        self.assertIn(date(2015, 4, 3), holidays)  # Good Friday
        self.assertIn(date(2015, 11, 26), holidays)  # Thanksgiving Thursday
        self.assertIn(date(2015, 11, 27), holidays)  # Thanksgiving Friday
        self.assertIn(date(2015, 12, 24), holidays)  # Xmas Eve
        self.assertIn(date(2015, 12, 26), holidays)  # Boxing Day

    def test_federal_year_2017(self):
        # It is different from other federal days.
        holidays = self.cal.holidays_set(2017)
        self.assertIn(date(2017, 4, 14), holidays)  # Good Friday
        self.assertIn(date(2017, 11, 23), holidays)  # Thanksgiving Thursday
        self.assertIn(date(2017, 11, 24), holidays)  # Thanksgiving Friday
        self.assertIn(date(2017, 12, 24), holidays)  # Xmas Eve
        self.assertIn(date(2017, 12, 25), holidays)  # Xmas Day
        self.assertIn(date(2017, 12, 26), holidays)  # Day after Xmas
        self.assertIn(date(2017, 12, 27), holidays)  # Xmas Shift

    def test_state_year_2016_xmas(self):
        # XMAS falls on SUN
        holidays = self.cal.holidays_set(2016)
        self.assertIn(date(2016, 12, 23), holidays)  # Day 1 - FRI
        self.assertIn(date(2016, 12, 26), holidays)  # Day 2 - MON
        self.assertIn(date(2016, 12, 27), holidays)  # Day 3 - TUE
        # 22nd and 28th are not included
        self.assertNotIn(date(2016, 12, 22), holidays)  # THU
        self.assertNotIn(date(2016, 12, 28), holidays)  # WED

    def test_state_year_2017_xmas(self):
        # XMAS falls on MON
        holidays = self.cal.holidays_set(2017)
        self.assertIn(date(2017, 12, 25), holidays)  # Day 1 - MON
        self.assertIn(date(2017, 12, 26), holidays)  # Day 2 - TUE
        self.assertIn(date(2017, 12, 27), holidays)  # Day 3 - WED
        # 22nd and 28th are not included
        self.assertNotIn(date(2017, 12, 22), holidays)  # FRI
        self.assertNotIn(date(2017, 12, 23), holidays)  # SAT
        self.assertNotIn(date(2017, 12, 28), holidays)  # THU

    def test_state_year_2018_xmas(self):
        # XMAS falls on TUE
        holidays = self.cal.holidays_set(2018)
        self.assertIn(date(2018, 12, 24), holidays)  # Day 1 - MON
        self.assertIn(date(2018, 12, 25), holidays)  # Day 2 - TUE
        self.assertIn(date(2018, 12, 26), holidays)  # Day 3 - WED
        # No shift:
        self.assertNotIn(date(2018, 12, 23), holidays)
        self.assertNotIn(date(2018, 12, 27), holidays)

    def test_state_year_2019_xmas(self):
        # XMAS falls on WED
        holidays = self.cal.holidays_set(2019)
        self.assertIn(date(2019, 12, 24), holidays)  # Day 1 - TUE
        self.assertIn(date(2019, 12, 25), holidays)  # Day 2 - WED
        self.assertIn(date(2019, 12, 26), holidays)  # Day 3 - THU
        # No shift:
        self.assertNotIn(date(2019, 12, 23), holidays)
        self.assertNotIn(date(2019, 12, 27), holidays)

    def test_state_year_2020_xmas(self):
        # XMAS falls on FRI
        holidays = self.cal.holidays_set(2020)
        self.assertIn(date(2020, 12, 24), holidays)  # Day 1 - THU
        self.assertIn(date(2020, 12, 25), holidays)  # Day 2 - FRI
        self.assertIn(date(2020, 12, 28), holidays)  # Day 3 - MON
        # 23rd and 29th are not included
        self.assertNotIn(date(2020, 12, 23), holidays)
        self.assertNotIn(date(2020, 12, 29), holidays)

    def test_state_year_2021_xmas(self):
        # XMAS falls on SAT
        holidays = self.cal.holidays_set(2021)
        self.assertIn(date(2021, 12, 23), holidays)  # Day 1 - THU
        self.assertIn(date(2021, 12, 24), holidays)  # Day 2 - FRI
        self.assertIn(date(2021, 12, 27), holidays)  # Day 3 - MON
        # 23rd and 29th are not included
        self.assertNotIn(date(2021, 12, 22), holidays)
        self.assertNotIn(date(2021, 12, 28), holidays)


class NorthDakotaTest(NoColumbus, UnitedStatesTest):
    cal_class = NorthDakota

    def test_state_year_2014(self):
        holidays = self.cal.holidays_set(2014)
        self.assertIn(date(2014, 4, 18), holidays)  # Good Friday

    def test_state_year_2015(self):
        holidays = self.cal.holidays_set(2015)
        self.assertIn(date(2015, 4, 3), holidays)  # Good Friday


class OhioTest(UnitedStatesTest):
    cal_class = Ohio
    # Ohio includes only Federal holidays.
    # The wikipedia page say it also includes Election Day, but no official
    # document confirms this.


class OklahomaTest(NoColumbus, UnitedStatesTest):
    cal_class = Oklahoma

    def test_state_year_2014(self):
        holidays = self.cal.holidays_set(2014)
        self.assertIn(date(2014, 11, 28), holidays)  # Thanksgiving Friday
        self.assertIn(date(2014, 12, 26), holidays)  # Boxing day

    def test_state_year_2015(self):
        holidays = self.cal.holidays_set(2015)
        self.assertIn(date(2015, 11, 27), holidays)  # Thanksgiving Friday
        self.assertIn(date(2015, 12, 26), holidays)  # Boxing day


class OregonTest(NoColumbus, UnitedStatesTest):
    cal_class = Oregon
    # NOTE: Oregon has only the federal holidays, except Columbus Day


class PennsylvaniaTest(ElectionDayEveryYear, UnitedStatesTest):
    cal_class = Pennsylvania

    def test_state_year_2014(self):
        holidays = self.cal.holidays_set(2014)
        self.assertIn(date(2014, 4, 18), holidays)  # Good Friday
        self.assertIn(date(2014, 11, 28), holidays)  # Thanksgiving Friday

    def test_state_year_2015(self):
        holidays = self.cal.holidays_set(2015)
        self.assertIn(date(2015, 4, 3), holidays)  # Good Friday
        self.assertIn(date(2015, 11, 27), holidays)  # Thanksgiving Friday


class RhodeIslandTest(NoPresidentialDay, ElectionDayEvenYears,
                      UnitedStatesTest):
    cal_class = RhodeIsland

    def test_state_year_2014(self):
        holidays = self.cal.holidays_set(2014)
        self.assertIn(date(2014, 8, 11), holidays)  # Victory Day

    def test_state_year_2015(self):
        holidays = self.cal.holidays_set(2015)
        self.assertIn(date(2015, 8, 10), holidays)  # Victory Day


class SouthCarolinaTest(NoColumbus, UnitedStatesTest):
    cal_class = SouthCarolina

    def test_state_year_2014(self):
        holidays = self.cal.holidays_set(2014)
        # Confederate Memorial Day
        self.assertIn(date(2014, 5, 10), holidays)
        # Observed here, it falls on SAT
        self.assertIn(date(2014, 5, 9), holidays)

        self.assertIn(date(2014, 11, 28), holidays)  # Thanksgiving Friday
        self.assertIn(date(2014, 12, 24), holidays)  # XMas Eve
        self.assertIn(date(2014, 12, 26), holidays)  # Boxing day

    def test_state_year_2015(self):
        holidays = self.cal.holidays_set(2015)
        self.assertIn(date(2015, 5, 10), holidays)  # Confederate Memorial Day
        self.assertIn(date(2015, 11, 27), holidays)  # Thanksgiving Friday
        self.assertIn(date(2015, 12, 24), holidays)  # Xmas Eve
        self.assertIn(date(2015, 12, 26), holidays)  # Boxing day

    @skip("No clear rules for implementing the XMas Eve shift")
    def test_state_year_2017(self):
        holidays = self.cal.holidays_set(2017)
        self.assertIn(date(2017, 5, 10), holidays)  # Confederate Memorial Day
        self.assertIn(date(2017, 11, 23), holidays)  # Thanksgiving Friday
        # Xmas Eve falls on SUN
        self.assertIn(date(2017, 12, 24), holidays)
        # Christmas Eve observed here
        self.assertIn(date(2017, 12, 22), holidays)
        self.assertIn(date(2017, 12, 26), holidays)  # Boxing day


class SouthDakotaTest(UnitedStatesTest):
    cal_class = SouthDakota
    # NOTE: South Dakota has all federal holidays, except Columbus Day,
    # but it's renamed as "Native Americans Day"

    def test_columbus_day_label(self):
        # Overwrite UnitedStatesTest.test_columbus_day_label
        _, label = self.cal.get_columbus_day(2017)
        self.assertEqual(label, "Native Americans Day")


class TennesseeTest(NoColumbus, UnitedStatesTest):
    cal_class = Tennessee

    def test_state_year_2014(self):
        holidays = self.cal.holidays_set(2014)
        self.assertIn(date(2014, 4, 18), holidays)  # Good Friday
        self.assertIn(date(2014, 12, 24), holidays)  # XMas Eve

    def test_state_year_2015(self):
        holidays = self.cal.holidays_set(2015)
        self.assertIn(date(2015, 4, 3), holidays)  # Good Friday
        self.assertIn(date(2015, 12, 24), holidays)  # XMas Eve


class TexasBaseTest(NoColumbus, UnitedStatesTest):
    cal_class = TexasBase
    # NOTE: "Stock" Texas doesn't include Columbus Day,
    # state holidays are handled differently

    def test_state_year_2014(self):
        holidays = self.cal.holidays_set(2014)
        # Check that state holidays are not included here
        self.assertNotIn(date(2014, 1, 19), holidays)  # Confederate Heroes Day
        self.assertNotIn(date(2014, 3, 2), holidays)  # Texas Independence Day
        self.assertNotIn(date(2014, 4, 21), holidays)  # San Jacinto Day
        self.assertNotIn(date(2014, 6, 19), holidays)  # Emancipation Day
        self.assertNotIn(date(2014, 8, 27), holidays)  # Lyndon B. Johnson Day
        self.assertNotIn(date(2014, 11, 28), holidays)  # Thanksgiving Friday
        self.assertNotIn(date(2014, 12, 24), holidays)  # XMas Eve
        self.assertNotIn(date(2014, 12, 26), holidays)  # Boxing day


class TexasTest(TexasBaseTest):
    cal_class = Texas

    def test_state_year_2014(self):
        holidays = self.cal.holidays_set(2014)
        self.assertIn(date(2014, 1, 19), holidays)  # Confederate Heroes Day
        self.assertIn(date(2014, 3, 2), holidays)  # Texas Independence Day
        self.assertIn(date(2014, 4, 21), holidays)  # San Jacinto Day
        self.assertIn(date(2014, 6, 19), holidays)  # Emancipation Day
        self.assertIn(date(2014, 8, 27), holidays)  # Lyndon B. Johnson Day
        self.assertIn(date(2014, 11, 28), holidays)  # Thanksgiving Friday
        self.assertIn(date(2014, 12, 24), holidays)  # XMas Eve
        self.assertIn(date(2014, 12, 26), holidays)  # Boxing day


class UtahTest(UnitedStatesTest):
    cal_class = Utah

    def test_state_year_2014(self):
        holidays = self.cal.holidays_set(2014)
        self.assertIn(date(2014, 7, 24), holidays)  # Pioneer Day

    def test_state_year_2015(self):
        holidays = self.cal.holidays_set(2015)
        self.assertIn(date(2015, 7, 24), holidays)  # Pioneer Day


class VermontTest(NoColumbus, UnitedStatesTest):
    cal_class = Vermont

    def test_state_year_2014(self):
        holidays = self.cal.holidays_set(2014)
        self.assertIn(date(2014, 3, 4), holidays)  # Town Meeting Day
        self.assertIn(date(2014, 8, 16), holidays)  # Bennington Battle Day
        self.assertIn(date(2014, 8, 15), holidays)  # Shifted to FRI

    def test_state_year_2015(self):
        holidays = self.cal.holidays_set(2015)
        self.assertIn(date(2015, 3, 3), holidays)  # Town Meeting Day
        self.assertIn(date(2015, 8, 16), holidays)  # Bennington Battle Day
        self.assertIn(date(2015, 8, 17), holidays)  # Shifted to MON


class VirginiaTest(UnitedStatesTest):
    cal_class = Virginia

    def test_state_year_2014(self):
        holidays = self.cal.holidays_set(2014)
        self.assertIn(date(2014, 1, 17), holidays)   # Lee-Jackson Day
        self.assertIn(date(2014, 11, 26), holidays)  # Thanksgiving Wednesday
        self.assertIn(date(2014, 11, 28), holidays)  # Thanksgiving Friday
        self.assertIn(date(2014, 12, 24), holidays)  # XMas Eve

    def test_state_year_2015(self):
        holidays = self.cal.holidays_set(2015)
        self.assertIn(date(2015, 1, 16), holidays)  # Lee-Jackson Day
        self.assertIn(date(2015, 11, 25), holidays)  # Thanksgiving Wednesday
        self.assertIn(date(2015, 11, 27), holidays)  # Thanksgiving Friday
        self.assertIn(date(2015, 12, 24), holidays)  # XMas Eve

    def test_exclude_thanksgiving_wednesday(self):
        # Sub class
        class VirginiaExclude(Virginia):
            include_thanksgiving_wednesday = False
        cal = VirginiaExclude()
        holidays = cal.holidays_set(2015)
        # Not Thanksgiving Wednesday
        self.assertNotIn(date(2015, 11, 25), holidays)

    def test_president_day_label(self):
        # Overwrite UnitedStatesTest.test_president_day_label
        _, label = self.cal.get_presidents_day(2017)
        self.assertEqual(label, "George Washington Day")

    def test_inauguration_day(self):
        # Overwriting this test: in 2017, this day is a public holiday for
        # Virginia State: Lee-Jackson Day
        # NOTE: 2013 test is not relevant, it's the same day as MLK day.
        # NOTE: 1985 test is not relevant, it's the same day as MLK day.
        # By default, it's not a public holiday
        self.assertNotIn(
            self.cal.get_inauguration_date(2009),
            self.cal.holidays_set(2009)
        )
        self.assertNotIn(
            self.cal.get_inauguration_date(1957),
            self.cal.holidays_set(1957)
        )


class WashingtonTest(NoColumbus, UnitedStatesTest):
    cal_class = Washington
    # NOTE: Washington State includes all federal holidays, except Columbus Day


class WestVirginiaTest(ElectionDayEvenYears, UnitedStatesTest):
    cal_class = WestVirginia

    def test_state_year_2014(self):
        holidays = self.cal.holidays_set(2014)
        self.assertIn(date(2014, 6, 20), holidays)  # West Virginia Day
        self.assertIn(date(2014, 11, 28), holidays)  # Thanksgiving Friday

    def test_state_year_2015(self):
        holidays = self.cal.holidays_set(2015)
        self.assertIn(date(2015, 6, 20), holidays)  # West Virginia Day
        self.assertIn(date(2015, 11, 27), holidays)  # Thanksgiving Friday

    def test_state_half_holidays_base(self):
        # Using the "stock" calendar
        holidays = self.cal.holidays_set(2015)
        self.assertNotIn(date(2015, 12, 24), holidays)  # XMas Eve
        self.assertNotIn(date(2015, 12, 31), holidays)  # NYE

    def test_state_half_holidays_included(self):
        class WestVirginiaInclude(WestVirginia):
            west_virginia_include_christmas_eve = True
            west_virginia_include_nye = True
        cal = WestVirginiaInclude()
        holidays = cal.holidays_set(2015)
        self.assertIn(date(2015, 12, 24), holidays)  # XMas Eve
        self.assertIn(date(2015, 12, 31), holidays)  # NYE
        # Test that these days are not shifted
        # In 2016, XMas Eve and NYE are on SAT
        holidays = cal.holidays_set(2016)
        self.assertIn(date(2016, 12, 24), holidays)  # XMas Eve
        self.assertIn(date(2016, 12, 31), holidays)  # NYE
        self.assertNotIn(date(2016, 12, 23), holidays)  # NO SHIFT for XMas Eve
        self.assertNotIn(date(2016, 12, 30), holidays)  # NO SHIFT for NYE

    def test_election_day_label(self):
        # Overwrite UnitedStatesTest.test_election_day_label
        _, label = self.cal.get_election_day(2017)
        self.assertEqual(label, "Election Day / Susan B. Anthony Day")


class WisconsinTest(NoPresidentialDay, NoColumbus, UnitedStatesTest):
    cal_class = Wisconsin

    def test_state_year_2014(self):
        holidays = self.cal.holidays_set(2014)
        self.assertIn(date(2014, 12, 24), holidays)  # Xmas Eve
        self.assertIn(date(2014, 12, 31), holidays)  # New Years Eve

    def test_state_year_2015(self):
        holidays = self.cal.holidays_set(2015)
        self.assertIn(date(2015, 12, 24), holidays)  # Xmas Eve
        self.assertIn(date(2015, 12, 31), holidays)  # New Years Eve


class WyomingTest(UnitedStatesTest):
    cal_class = Wyoming
    # NOTE: Wyoming only has all federal holidays

    def test_mlk_label(self):
        # Overwrite UnitedStatesTest.test_mlk_label
        _, label = self.cal.get_martin_luther_king_day(2017)
        self.assertEqual(
            label,
            "Martin Luther King, Jr. / Wyoming Equality Day"
        )


class AmericanSamoaTest(UnitedStatesTest):
    cal_class = AmericanSamoa

    def test_family_day(self):
        holidays = self.cal.holidays_set(2019)
        self.assertIn(date(2019, 12, 26), holidays)  # Family Day

    def test_flag_day(self):
        holidays = self.cal.holidays_set(2019)
        self.assertIn(date(2019, 4, 17), holidays)  # Flag Day

    def test_family_day_label(self):
        holidays = self.cal.holidays(2019)
        holidays_dict = dict(holidays)
        self.assertEqual(holidays_dict[date(2019, 12, 26)], "Family Day")


class Guam(UnitedStatesTest):
    cal_class = Guam

    def test_state_year_2019(self):
        holidays = self.cal.holidays_set(2019)
        # Guam History and Chamorro Heritage Day
        self.assertIn(date(2019, 3, 7), holidays)
        self.assertIn(date(2019, 7, 21), holidays)  # Liberation Day
        self.assertIn(date(2019, 11, 2), holidays)  # All Souls Day
        self.assertIn(date(2019, 12, 8), holidays)  # Lady of Camarin Day

    def test_state_year_2018(self):
        holidays = self.cal.holidays_set(2020)
        # Guam History and Chamorro Heritage Day
        self.assertIn(date(2020, 3, 7), holidays)
        self.assertIn(date(2020, 7, 21), holidays)  # Liberation Day
        self.assertIn(date(2020, 11, 2), holidays)  # All Souls Day
        self.assertIn(date(2020, 12, 8), holidays)  # Lady of Camarin Day

    def test_lady_of_camarin_label(self):
        holidays = self.cal.holidays(2019)
        holidays_dict = dict(holidays)
        self.assertEqual(
            holidays_dict[date(2019, 12, 8)],
            "Lady of Camarin Day"
        )


class NormalShiftTestCase(UnitedStatesTest):
    # Using a fake calendar here
    class NormalShiftUnitedStates(UnitedStates):
        "Normal Shift Fake United State calendar"
        include_christmas_eve = True

    cal_class = NormalShiftUnitedStates

    def test_shift_2015(self):
        # Test a normal shift on 4th of July.
        # 2015: Happens on a Saturday, observed on FRI
        holidays = self.cal.holidays(2015)
        holiday_dict = dict(holidays)
        fourth_july = date(2015, 7, 4)
        observed = date(2015, 7, 3)
        self.assertIn(fourth_july, holiday_dict)
        self.assertEqual(holiday_dict[fourth_july], "Independence Day")
        self.assertIn(observed, holiday_dict)
        self.assertEqual(holiday_dict[observed], "Independence Day (Observed)")

    def test_shift_2010(self):
        # Test a normal shift on 4th of July.
        # 2010: Happens on a SUN, observed on MON
        holidays = self.cal.holidays(2010)
        holiday_dict = dict(holidays)
        fourth_july = date(2010, 7, 4)
        observed = date(2010, 7, 5)
        self.assertIn(fourth_july, holiday_dict)
        self.assertEqual(holiday_dict[fourth_july], "Independence Day")
        self.assertIn(observed, holiday_dict)
        self.assertEqual(holiday_dict[observed], "Independence Day (Observed)")

    def test_new_years_shift(self):
        # If January, 1st *of the year after* happens on SAT, add New Years Eve
        holidays = self.cal.holidays(2010)
        holiday_dict = dict(holidays)
        new_years_eve = date(2010, 12, 31)
        self.assertIn(new_years_eve, holiday_dict)
        self.assertEqual(
            holiday_dict[new_years_eve],
            "New Years Day (Observed)"
        )
        # The year after, it's not shifted
        holidays = self.cal.holidays_set(2011)
        new_years_eve = date(2011, 12, 31)
        self.assertNotIn(new_years_eve, holidays)

    def test_christmas_extra_shift_2010(self):
        # XMAs Eve is included. *and* XMas falls on SAT.
        # So you have the following holidays:
        # * 24th & 25th (XMas Eve and XMas day)
        # * 27th (XMas Shift)
        # * 23rd (XMas Eve shifted on THU)
        holidays = self.cal.holidays(2010)
        holiday_dict = dict(holidays)
        dec_23rd = date(2010, 12, 23)
        dec_24th = date(2010, 12, 24)
        dec_25th = date(2010, 12, 25)
        for day in (dec_23rd, dec_24th, dec_25th):
            self.assertIn(day, holiday_dict)
        self.assertEqual(holiday_dict[dec_23rd], "Christmas Eve (Observed)")
        self.assertEqual(holiday_dict[dec_24th], "Christmas Eve")
        self.assertEqual(holiday_dict[dec_25th], "Christmas Day")

    def test_christmas_extra_shift_2006(self):
        # XMAs Eve is included. *and* XMas falls on MON.
        # So you have the following holidays:
        # * 24th & 25th (XMas Eve and XMas day)
        # * 26th (XMas Shift)
        holidays = self.cal.holidays(2006)
        holiday_dict = dict(holidays)
        dec_24th = date(2006, 12, 24)
        dec_25th = date(2006, 12, 25)
        dec_26th = date(2006, 12, 26)
        for day in (dec_24th, dec_25th, dec_26th):
            self.assertIn(day, holiday_dict)
        self.assertEqual(holiday_dict[dec_24th], "Christmas Eve")
        self.assertEqual(holiday_dict[dec_25th], "Christmas Day")
        self.assertEqual(holiday_dict[dec_26th], "Christmas Day (Observed)")


class ShiftExceptionsTestCase(UnitedStatesTest):
    # Using a fake calendar here
    class ShiftExceptionsCalendar(UnitedStates):
        "Normal Shift Fake United State calendar"
        shift_exceptions = (
            (7, 4),  # Month/Day == Fourth of July.
        )

    cal_class = ShiftExceptionsCalendar

    def test_shift_2015(self):
        # Test a normal shift on 4th of July.
        # 2015: Happens on a Saturday, not shifted
        holidays = self.cal.holidays(2015)
        holiday_dict = dict(holidays)
        fourth_july = date(2015, 7, 4)
        observed = date(2015, 7, 3)
        self.assertIn(fourth_july, holiday_dict)
        self.assertEqual(holiday_dict[fourth_july], "Independence Day")
        self.assertNotIn(observed, holiday_dict)

    def test_shift_2010(self):
        # Test a normal shift on 4th of July.
        # 2010: Happens on a SUN, not shifted
        holidays = self.cal.holidays(2010)
        holiday_dict = dict(holidays)
        fourth_july = date(2010, 7, 4)
        observed = date(2010, 7, 5)
        self.assertIn(fourth_july, holiday_dict)
        self.assertEqual(holiday_dict[fourth_july], "Independence Day")
        self.assertNotIn(observed, holiday_dict)


class ShiftExceptionsNextYearTestCase(UnitedStatesTest):
    class ShiftExceptionsCalendar(UnitedStates):
        "Shift exception happens on jan 1st and XMas"
        shift_exceptions = (
            (1, 1),  # January 1st
            (12, 25),  # Christmas Day
        )

    cal_class = ShiftExceptionsCalendar

    def test_shift_2021(self):
        # January 1st is a saturday in 2022
        # As a consequence, Dec 31st should be a holiday.
        # BUT here, January 1st is in the shift_exceptions,
        # so 2021-12-31 should be a working day
        holidays = self.cal.holidays_set(2021)
        # XMas is a holiday
        self.assertIn(date(2021, 12, 25), holidays)
        # XMas eve is a working day
        self.assertNotIn(date(2021, 12, 24), holidays)

        # January 1st is a non-shift, Dec 31st should be a working day
        self.assertNotIn(date(2021, 12, 31), holidays)
        self.assertTrue(self.cal.is_working_day(date(2021, 12, 31)))


class FederalReserveSystemTest(UnitedStatesTest):

    cal_class = FederalReserveSystem

    def test_juneteenth_day(self):

        holidays = self.cal.holidays_set(2021)
        juneteenth, _ = self.cal.get_juneteenth_day(2021)
        self.assertEqual(date(2021, 6, 19), juneteenth)
        # 2021-06-19 is a Saturday so holiday is shifted
        self.assertIn(date(2021, 6, 18), holidays)

        holidays = self.cal.holidays_set(2022)
        juneteenth, _ = self.cal.get_juneteenth_day(2022)
        self.assertEqual(date(2022, 6, 19), juneteenth)
        # 2022-06-19 is a Sunday so holiday is shifted
        self.assertIn(date(2022, 6, 20), holidays)

        holidays = self.cal.holidays_set(2023)
        juneteenth, _ = self.cal.get_juneteenth_day(2023)
        self.assertEqual(date(2023, 6, 19), juneteenth)
        self.assertIn(juneteenth, holidays)

        # No JuneTeeth before 2021
        holidays = self.cal.holidays_set(2020)
        self.assertNotIn(date(2020, 6, 20), holidays)
        with self.assertRaises(ValueError):
            self.cal.get_juneteenth_day(2020)