Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using 'TtrCrnchr' as the originator #459

Merged
merged 6 commits into from
Sep 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class Settings(BaseSettings):
# https://support.messagebird.com/hc/en-us/articles/208747865-United-States
us_send_number = '15744445663'
canada_send_number = '12048170659'
inbox_send_number = 'inbox'
tc_registered_originator = 'TtrCrnchr'

@validator('pg_dsn')
def heroku_ready_pg_dsn(cls, v):
Expand Down
2 changes: 1 addition & 1 deletion src/worker/sms.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def __init__(self, ctx: dict, group_id: int, company_id: int, recipient: SmsReci
elif self.m.country_code == 'CA':
self.from_name = self.settings.canada_send_number
else:
self.from_name = self.settings.inbox_send_number
self.from_name = self.settings.tc_registered_originator

async def run(self):
sms_data = await self._sms_prep()
Expand Down
4 changes: 2 additions & 2 deletions tests/test_sms.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def test_send_message(cli, tmpdir, worker, loop):
"to: Number(number='+447891123856', country_code='44', "
"number_formatted='+44 7891 123856', descr=None, is_mobile=True)"
) in msg_file
assert f'\nfrom_name: {settings.inbox_send_number}\n' in msg_file
assert f'\nfrom_name: {settings.tc_registered_originator}\n' in msg_file
assert '\nmessage:\nthis is a message bar\n' in msg_file
assert '\nlength: SmsLength(length=21, parts=1)\n' in msg_file

Expand Down Expand Up @@ -351,7 +351,7 @@ def test_link_shortening(cli, tmpdir, sync_db: SyncDb, worker, loop):
f = '69eb85e8-1504-40aa-94ff-75bb65fd8d75-447891123856.txt'
assert str(tmpdir.listdir()[0]).endswith(f)
msg_file = tmpdir.join(f).read()
assert f'\nfrom_name: {settings.inbox_send_number}\n' in msg_file
assert f'\nfrom_name: {settings.tc_registered_originator}\n' in msg_file
assert '\nmessage:\nthis is a message click.example.com/l' in msg_file
token = re.search('message click.example.com/l(.+?)\n', msg_file).groups()[0]
assert len(token) == 12
Expand Down
Loading