示例#1
0
def test_list_validation_index_on_exception():
    field = ListField(StringField())
    try:
        field.validate(FIELD_NAME, TEST_LIST_MIXED)
    except ListFieldInvalidError as e:
        assert e.index == 1
示例#2
0
def test_list_validation_success():
    field = ListField(StringField())
    field.validate(FIELD_NAME, TEST_LIST_STRINGS)
示例#3
0
def test_list_validation_error_type():
    field = ListField(StringField())
    field.validate(FIELD_NAME, TEST_LIST_MIXED)
示例#4
0
def test_list_validation_success_empty():
    field = ListField(StringField())
    field.validate(FIELD_NAME, TEST_LIST_EMPTY)
示例#5
0
def test_list_validation_index_on_exception():
    field = ListField(StringField())
    try:
        field.validate(FIELD_NAME, TEST_LIST_MIXED)
    except ListFieldInvalidError as e:
        assert e.index == 1
示例#6
0
def test_list_validation_error_type():
    field = ListField(StringField())
    field.validate(FIELD_NAME, TEST_LIST_MIXED)
示例#7
0
def test_list_validation_success():
    field = ListField(StringField())
    field.validate(FIELD_NAME, TEST_LIST_STRINGS)
示例#8
0
def test_list_validation_success_empty():
    field = ListField(StringField())
    field.validate(FIELD_NAME, TEST_LIST_EMPTY)