Пример #1
0
def format_postal_code(postal_code):
    from stoqlib.lib.validators import validate_postal_code
    if not validate_postal_code(postal_code):
        return postal_code
    postal_code = raw_postal_code(postal_code)
    return "%s-%s" % (postal_code[:5],
                      postal_code[5:8])
Пример #2
0
def test_validate_postal_code():
    assert validators.validate_postal_code("") is False