def test_to_date_passes_none_through():
    assert_that(to_date(None), is_(None))
def test_to_date_passes_date_through():
    assert_that(
        to_date(date(2012, 12, 12)),
        equal_to(date(2012, 12, 12)))
def test_to_date_raises_error_on_invalid_input():
    to_date("")
def test_to_date_converts_datetime_to_date():
    assert_that(
        to_date(datetime(2012, 12, 12)),
        equal_to(date(2012, 12, 12)))