Files
zkxw/backend/tests/test_wechat_mini_auth_phone.py
T

16 lines
462 B
Python

"""手机号规范化单测(微信登录匹配 sys_user.phone_no)。"""
from app.services.wechat_mini_auth import normalize_cn_mobile
def test_normalize_strips_plus_86():
assert normalize_cn_mobile("+8613800138000") == "13800138000"
def test_normalize_strips_spaces():
assert normalize_cn_mobile(" 138 0013 8000 ") == "13800138000"
def test_normalize_empty():
assert normalize_cn_mobile("") == ""
assert normalize_cn_mobile(None) == ""