def test_to_weekday_from_string():
    assert recurrence.to_weekday("3") == recurrence.Weekday(3)

    with pytest.raises(ValueError):
        recurrence.to_weekday("7")

    assert recurrence.to_weekday("MO") == recurrence.Weekday(0)
    assert recurrence.to_weekday("mo") == recurrence.Weekday(0)
    assert recurrence.to_weekday("TU") == recurrence.Weekday(1)
    assert recurrence.to_weekday("Tu") is recurrence.Weekday(1)

    with pytest.raises(ValueError):
        recurrence.to_weekday("FOO")

    assert recurrence.to_weekday("-2TU") == recurrence.Weekday(1, -2)

    # We don't do any validation of the index
    assert recurrence.to_weekday("-7SU") == recurrence.Weekday(6, -7)
dataset/ETHPy150Open django-recurrence/django-recurrence/tests/test_to_weekday.py/test_to_weekday_from_string/operator `==` -> `is`