mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-01 07:35:34 -05:00
Format sequential number into an 8 char long hex
As per Vodafone spec for ibag format message number
This commit is contained in:
@@ -303,6 +303,7 @@ def test_trigger_link_tests_invokes_cbc_proxy_client(
|
||||
|
||||
# testing sequential number:
|
||||
if provider == 'vodafone':
|
||||
assert type(mock_send_link_test.mock_calls[0][1][1]) is int
|
||||
assert type(mock_send_link_test.mock_calls[0][1][1]) is str
|
||||
assert len(mock_send_link_test.mock_calls[0][1][1]) == 8
|
||||
else:
|
||||
assert not mock_send_link_test.mock_calls[0][1][1]
|
||||
|
||||
@@ -4,10 +4,11 @@ import pytest
|
||||
from freezegun import freeze_time
|
||||
|
||||
from app.utils import (
|
||||
format_sequential_number,
|
||||
get_london_midnight_in_utc,
|
||||
get_midnight_for_day_before,
|
||||
midnight_n_days_ago,
|
||||
get_notification_table_to_use,
|
||||
midnight_n_days_ago
|
||||
)
|
||||
from app.models import Notification, NotificationHistory
|
||||
|
||||
@@ -99,3 +100,7 @@ def test_get_notification_table_to_use_checks_service_data_retention(sample_serv
|
||||
# falls back to 7 days if not specified
|
||||
assert get_notification_table_to_use(sample_service, 'sms', date(2019, 1, 1), False) == NotificationHistory
|
||||
assert get_notification_table_to_use(sample_service, 'sms', date(2019, 1, 2), False) == Notification
|
||||
|
||||
|
||||
def test_format_sequential_number():
|
||||
assert format_sequential_number(123) == '0000007b'
|
||||
|
||||
Reference in New Issue
Block a user