mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-14 23:08:07 -04:00
Replace format_recipient with PostalAddress.as_single_line
We’ve refactored the code to display an address on a single line with commas into utils now.
This commit is contained in:
@@ -8,7 +8,6 @@ from flask import make_response, url_for
|
||||
from freezegun import freeze_time
|
||||
from requests import RequestException
|
||||
|
||||
from app.main.views.uploads import format_recipient
|
||||
from app.s3_client.s3_letter_upload_client import LetterMetadata
|
||||
from app.utils import normalize_spaces
|
||||
from tests.conftest import (
|
||||
@@ -947,18 +946,6 @@ def test_send_uploaded_letter_when_metadata_states_pdf_is_invalid(
|
||||
assert not mock_send.called
|
||||
|
||||
|
||||
@pytest.mark.parametrize('original_address,expected_address', [
|
||||
('The Queen, Buckingham Palace, SW1 1AA', 'The Queen, Buckingham Palace, SW1 1AA'),
|
||||
('The Queen Buckingham Palace SW1 1AA', 'The Queen Buckingham Palace SW1 1AA'),
|
||||
('The Queen,\nBuckingham Palace,\r\nSW1 1AA', 'The Queen, Buckingham Palace, SW1 1AA'),
|
||||
('The Queen ,,\nBuckingham Palace,\rSW1 1AA,', 'The Queen, Buckingham Palace, SW1 1AA'),
|
||||
(' The Queen\n Buckingham Palace\n SW1 1AA', 'The Queen, Buckingham Palace, SW1 1AA'),
|
||||
('', ''),
|
||||
])
|
||||
def test_format_recipient(original_address, expected_address):
|
||||
assert format_recipient(original_address) == expected_address
|
||||
|
||||
|
||||
@pytest.mark.parametrize('user', (
|
||||
create_active_caseworking_user(),
|
||||
create_active_user_with_permissions(),
|
||||
|
||||
Reference in New Issue
Block a user