def test_yom_hashoah_on_sunday():
    expected = {
        'settings': {
            'date': date.fromisoformat('2024-04-01'),
            'holiday_name': 'yom_hashoah'
        },
        'date': date.fromisoformat('2024-05-06')
    }

    actual = get_simple_holiday(SimpleHolidayChoices.yom_hashoah.value,
                                date(2024, 4, 1))
    assert actual.dict(exclude_none=True, by_alias=True) == expected
def test_yom_hazikaron():
    expected = {
        'settings': {
            'date': date.fromisoformat('2020-04-15'),
            'holiday_name': 'yom_hazikaron'
        },
        'date': date.fromisoformat('2020-04-28')
    }

    actual = get_simple_holiday(SimpleHolidayChoices.yom_hazikaron.value,
                                PY_DATE)
    assert actual.dict(exclude_none=True, by_alias=True) == expected
def test_regular_holiday():
    expected = {
        'settings': {
            'date': date.fromisoformat('2020-04-15'),
            'holiday_name': 'tu_bi_shvat'
        },
        'date': date.fromisoformat('2021-01-28')
    }

    actual = get_simple_holiday(SimpleHolidayChoices.tu_bi_shvat.value,
                                PY_DATE)
    assert actual.dict(exclude_none=True, by_alias=True) == expected
def test_yom_hazikaron_friday_yom_haatzmaut_shabbat():
    expected_1 = {
        'settings': {
            'date': date.fromisoformat('2021-04-01'),
            'holiday_name': 'yom_hazikaron'
        },
        'date': date.fromisoformat('2021-04-14')
    }
    expected_2 = {
        'settings': {
            'date': date.fromisoformat('2021-04-01'),
            'holiday_name': 'yom_haatzmaut'
        },
        'date': date.fromisoformat('2021-04-15')
    }

    actual_1 = get_simple_holiday(SimpleHolidayChoices.yom_hazikaron.value,
                                  date(2021, 4, 1))
    actual_2 = get_simple_holiday(SimpleHolidayChoices.yom_haatzmaut.value,
                                  date(2021, 4, 1))
    assert actual_1.dict(exclude_none=True, by_alias=True) == expected_1
    assert actual_2.dict(exclude_none=True, by_alias=True) == expected_2