def test_abc_with_decimal_argument_fails(): """Test that string with letters in fails when we supply 'decimal'.""" test = CastToDecimal()( 'abc', 'integer_containing_decimals', ) assert not is_successful(test) assert isinstance(test.failure(), ValueError) assert 'Illegal characters in value' in str(test.failure())
def test_abc_fails(): """Test that string with letters in fails.""" test = CastToDecimal()('abc') assert not is_successful(test) assert isinstance(test.failure(), ValueError) assert 'Illegal characters in value' in str(test.failure())