Files
notifications-api/tests/app/letters/test_letter_utils.py
2018-03-07 23:03:03 +00:00

19 lines
586 B
Python

import pytest
from app.letters.utils import get_bucket_prefix_for_notification
def test_get_bucket_prefix_for_notification_valid_notification(sample_notification):
bucket_prefix = get_bucket_prefix_for_notification(sample_notification)
assert bucket_prefix == '{folder}/NOTIFY.{reference}'.format(
folder=sample_notification.created_at.date(),
reference=sample_notification.reference
).upper()
def test_get_bucket_prefix_for_notification_invalid_notification():
with pytest.raises(AttributeError):
get_bucket_prefix_for_notification(None)