def test_none_value(self): """ Test None value treatment for the float field""" score = Float(max_value=5.5) score._load(None) assert score.value == 0.0
def test_max_value(self): """ Test maximum value validation for the float field""" with pytest.raises(ValidationError): score = Float(max_value=5.5) score._load(5.6)
def test_type_validation(self): """ Test type checking validation for the Field""" with pytest.raises(ValidationError): score = Float() score._load('x')