Added tests to tests for precompiled flow and refactored a little

* Added is_precompiled_letter method to letter/utils.py
* Added tests for letter/utils.py
* Added tests for the rest endpoint
* Moved the Precompiled name to a central location
* Added hidden field to the test method to create a template
This commit is contained in:
Richard Chapman
2018-03-05 14:11:37 +00:00
parent a9a67ce542
commit a4feaba309
6 changed files with 272 additions and 14 deletions

View File

@@ -125,12 +125,13 @@ def create_service_with_defined_sms_sender(
def create_template(
service,
template_type=SMS_TYPE,
template_name=None,
subject='Template subject',
content='Dear Sir/Madam, Hello. Yours Truly, The Government.',
reply_to=None
service,
template_type=SMS_TYPE,
template_name=None,
subject='Template subject',
content='Dear Sir/Madam, Hello. Yours Truly, The Government.',
reply_to=None,
hidden=False
):
data = {
'name': template_name or '{} Template Name'.format(template_type),
@@ -139,6 +140,7 @@ def create_template(
'service': service,
'created_by': service.created_by,
'reply_to': reply_to,
'hidden': hidden
}
if template_type != SMS_TYPE:
data['subject'] = subject