mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-02 17:31:14 -05:00
Refactor is_precompiled_letter to model
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import pytest
|
||||
from flask import current_app
|
||||
|
||||
from app.letters.utils import get_bucket_prefix_for_notification, is_precompiled_letter
|
||||
from app.letters.utils import get_bucket_prefix_for_notification
|
||||
|
||||
|
||||
def test_get_bucket_prefix_for_notification_valid_notification(sample_notification):
|
||||
@@ -17,23 +16,3 @@ def test_get_bucket_prefix_for_notification_valid_notification(sample_notificati
|
||||
def test_get_bucket_prefix_for_notification_invalid_notification():
|
||||
with pytest.raises(AttributeError):
|
||||
get_bucket_prefix_for_notification(None)
|
||||
|
||||
|
||||
def test_is_precompiled_letter_false(sample_letter_template):
|
||||
assert not is_precompiled_letter(sample_letter_template)
|
||||
|
||||
|
||||
def test_is_precompiled_letter_true(sample_letter_template):
|
||||
sample_letter_template.hidden = True
|
||||
sample_letter_template.name = current_app.config['PRECOMPILED_TEMPLATE_NAME']
|
||||
assert is_precompiled_letter(sample_letter_template)
|
||||
|
||||
|
||||
def test_is_precompiled_letter_hidden_true_not_name(sample_letter_template):
|
||||
sample_letter_template.hidden = True
|
||||
assert not is_precompiled_letter(sample_letter_template)
|
||||
|
||||
|
||||
def test_is_precompiled_letter_name_correct_not_hidden(sample_letter_template):
|
||||
sample_letter_template.name = current_app.config['PRECOMPILED_TEMPLATE_NAME']
|
||||
assert not is_precompiled_letter(sample_letter_template)
|
||||
|
||||
Reference in New Issue
Block a user