def test_clean_failed(self): condition = AbstractDate() with pytest.raises(ValidationError): condition.clean("20160101")
def test_clean_success(self): condition = AbstractDate() assert condition.clean('2016-01-01') == '2016-01-01'