예제 #1
0
def test_address__normalize_phone_number__6():
    """`normalize_phone_number` replaces leading '00' by plus sign.

    The country code is ignored in this case.
    """
    assert '+421234567891' == normalize_phone_number('0042-1234/5678-91',
                                                     '+49')
예제 #2
0
def test_address__normalize_phone_number__7():
    """`normalize_phone_number` replaces only leading '00' by plus sign."""
    assert '+421234007891' == normalize_phone_number('0042-1234/0078-91',
                                                     '+49')
예제 #3
0
def test_address__normalize_phone_number__5():
    """`normalize_phone_number` does not replace '0' on empty country code."""
    assert '01234567891' == normalize_phone_number('01234/5678-91', '')
예제 #4
0
def test_address__normalize_phone_number__4():
    """`normalize_phone_number` replaces only the first '0' by country code."""
    assert '+491234507090' == normalize_phone_number('01234/5070-90', '+49')
예제 #5
0
def test_address__normalize_phone_number__3():
    """`normalize_phone_number` replaces a leading '0' by the country code."""
    assert '+491234567891' == normalize_phone_number('01234/5678-91', '+49')
예제 #6
0
def test_address__normalize_phone_number__2():
    """`normalize_phone_number` keeps only numbers and a leading plus sign."""
    assert '+491234567890' == normalize_phone_number('+49 (1234) 5678 - 90X',
                                                     '+49')
예제 #7
0
def test_address__normalize_phone_number__1():
    """`normalize_phone_number` returns a normalized number unchanged."""
    assert '+491234567890' == normalize_phone_number('+491234567890', '+49')