Example #1
0
def test_validate_boolean_invalid():
    with pytest.raises(ValidationError) as exception_info:
        validate_boolean("FOO")
    assert 'FOO must be either "true" or "false"' in str(exception_info)
Example #2
0
def test_validate_boolean_truthy():
    validate_boolean("true")
    validate_boolean("TRUE")
    validate_boolean("T")
    validate_boolean("1")
    validate_boolean("Y")
    validate_boolean("YES")
Example #3
0
def test_validate_boolean_falsy():
    validate_boolean("false")
    validate_boolean("FALSE")
    validate_boolean("F")
    validate_boolean("0")
    validate_boolean("N")
    validate_boolean("No")
def test_validate_boolean_invalid():
    with pytest.raises(ValidationError) as exception_info:
        validate_boolean("FOO")
    assert 'FOO must be either "true" or "false"' in str(exception_info)
def test_validate_boolean_falsy():
    validate_boolean("false")
    validate_boolean("FALSE")
    validate_boolean("F")
    validate_boolean("0")
    validate_boolean("N")
    validate_boolean("No")
def test_validate_boolean_truthy():
    validate_boolean("true")
    validate_boolean("TRUE")
    validate_boolean("T")
    validate_boolean("1")
    validate_boolean("Y")
    validate_boolean("YES")
Example #7
0
def test_validate_boolean_falsy():
    validate_boolean('false')
    validate_boolean('FALSE')
    validate_boolean('F')
    validate_boolean('0')
    validate_boolean('N')
    validate_boolean('No')
Example #8
0
def test_validate_boolean_truthy():
    validate_boolean('true')
    validate_boolean('TRUE')
    validate_boolean('T')
    validate_boolean('1')
    validate_boolean('Y')
    validate_boolean('YES')