Esempio n. 1
0
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())
Esempio n. 2
0
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())