mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-24 01:11:38 -05:00
rename template.serialize to serialize_for_v2
make it clear that this is for the public api, and we shouldn't add fields to it without considering impacts also add the broadcast_messages relationship on service and template to the exclude from the marshmallow schemas, so it's not included elsewhere
This commit is contained in:
@@ -214,17 +214,17 @@ def test_notification_serializes_created_by_name_with_created_by_id(client, samp
|
||||
|
||||
|
||||
def test_sms_notification_serializes_without_subject(client, sample_template):
|
||||
res = sample_template.serialize()
|
||||
res = sample_template.serialize_for_v2()
|
||||
assert res['subject'] is None
|
||||
|
||||
|
||||
def test_email_notification_serializes_with_subject(client, sample_email_template):
|
||||
res = sample_email_template.serialize()
|
||||
res = sample_email_template.serialize_for_v2()
|
||||
assert res['subject'] == 'Email Subject'
|
||||
|
||||
|
||||
def test_letter_notification_serializes_with_subject(client, sample_letter_template):
|
||||
res = sample_letter_template.serialize()
|
||||
res = sample_letter_template.serialize_for_v2()
|
||||
assert res['subject'] == 'Template subject'
|
||||
|
||||
|
||||
|
||||
@@ -44,7 +44,6 @@ def test_get_template_by_id_returns_200(
|
||||
'name': expected_name,
|
||||
'personalisation': {},
|
||||
'postage': postage,
|
||||
'broadcast_data': None,
|
||||
}
|
||||
|
||||
assert json_response == expected_response
|
||||
|
||||
@@ -2,7 +2,7 @@ import pytest
|
||||
|
||||
from flask import json
|
||||
|
||||
from app.models import EMAIL_TYPE, LETTER_TYPE, SMS_TYPE, TEMPLATE_TYPES
|
||||
from app.models import EMAIL_TYPE, LETTER_TYPE, TEMPLATE_TYPES
|
||||
from tests import create_authorization_header
|
||||
from tests.app.db import create_template
|
||||
|
||||
|
||||
Reference in New Issue
Block a user