test_wechat_mini_auth_phone.py 462 B

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