rename letter get_folder_name args

`_now`? why would we ever use a different _now? instead say created_at,
because that's what it'll always be set to, even if we're replaying old
letters. We always set the folder name to when the letter was
created_at, or we might not know where to look to find it.

`dont_use_sending_date` doesn't really tell us what might happen if we
don't use it - the answer is we return an empty string. we ignore the
folder entirely. so lets call it that.

Also, remove use of freeze_gun in the tests, to prove that we don't use
the current time in any calculations. Also add an assert to a mock in
the get_pdf_for_templated_letter test, because we were mocking but not
asserting before, so the tests didn't fail when the function signature
changed.
This commit is contained in:
Leo Hemsted
2020-09-21 13:46:31 +01:00
parent 120b760cae
commit bb33927b3d
6 changed files with 33 additions and 23 deletions

View File

@@ -196,7 +196,7 @@ def send_pdf_letter_notification(service_id, post_data):
reference=notification.reference,
crown=notification.service.crown,
sending_date=notification.created_at,
dont_use_sending_date=False,
ignore_folder=False,
postage=notification.postage
)