def test_datetime():
    'Test date time validation.'
    schema = vol.Schema(cv.datetime)
    for value in [date.today(), 'Wrong DateTime', '2016-11-23']:
        with pytest.raises(vol.MultipleInvalid):
            schema(value)
    schema(datetime.now())
    schema('2016-11-23T18:59:08')
Test date time validation.
def test_datetime():
    
    schema = vol.Schema(cv.datetime)
    for value in [date.today(), 'Wrong DateTime', '2016-11-23']:
        with pytest.raises(vol.MultipleInvalid):
            schema(value)
    schema(datetime.now())
    schema('2016-11-23T18:59:08')