def test_date():
    'Test date validation.'
    schema = vol.Schema(cv.date)
    for value in ['Not a date', '23:42', '2016-11-23T18:59:08']:
        with pytest.raises(vol.Invalid):
            schema(value)
    schema(datetime.now().date())
    schema('2016-11-23')
Test date validation.
def test_date():
    
    schema = vol.Schema(cv.date)
    for value in ['Not a date', '23:42', '2016-11-23T18:59:08']:
        with pytest.raises(vol.Invalid):
            schema(value)
    schema(datetime.now().date())
    schema('2016-11-23')