12 lines
573 B
Python
12 lines
573 B
Python
from passerelle.sms import SMSGatewayMixin
|
|
|
|
def test_clean_numbers():
|
|
assert SMSGatewayMixin.clean_numbers(['+ 33 12'], '33') == ['+3312']
|
|
assert SMSGatewayMixin.clean_numbers(['0 0 33 12'], '33') == ['+3312']
|
|
assert SMSGatewayMixin.clean_numbers(['0 12'], '33') == ['+3312']
|
|
|
|
def test_clean_numbers_no_prefix():
|
|
assert SMSGatewayMixin.clean_numbers(['+ 33 12'], '33', prefix='') == ['3312']
|
|
assert SMSGatewayMixin.clean_numbers(['0 0 33 12'], '33', prefix='') == ['3312']
|
|
assert SMSGatewayMixin.clean_numbers(['0 12'], '33', prefix='') == ['3312']
|