def test_to_python_any(self): field = ListField() value = field.to_python(MockConfig(), [1, 2, 3]) assert value == [1, 2, 3] assert isinstance(value, list)
def test_to_python(self): field = ListField(IntField(), required=True) wrap = field.to_python(MockConfig(), [1, 2, '3']) assert wrap.list_field is field assert wrap.item_field is field.field assert wrap == [1, 2, 3]