mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-03 01:41:05 -05:00
Refactor postcode validation to use utils
We don’t need to reformat the postcode here once template preview takes care of it when rendering the PDF. It’s better (and less code) to store what people give us, so we give them back the same thing.
This commit is contained in:
@@ -139,7 +139,9 @@ def test_post_letter_notification_formats_postcode(
|
||||
|
||||
assert validate(resp_json, post_letter_response) == resp_json
|
||||
notification = Notification.query.one()
|
||||
assert notification.personalisation["postcode"] == "SW1 1AA"
|
||||
# We store what the client gives us, and only reformat it when
|
||||
# generating the PDF
|
||||
assert notification.personalisation["postcode"] == ' Sw1 1aa '
|
||||
|
||||
|
||||
def test_post_letter_notification_throws_error_for_bad_postcode(
|
||||
|
||||
Reference in New Issue
Block a user