mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-29 18:54:01 -04:00
@@ -103,18 +103,12 @@ class BaseAPIClient:
|
||||
except requests.RequestException as e:
|
||||
api_error = HTTPError.create(e)
|
||||
logger.warning(
|
||||
"API %s request on %s failed with %s '%s'",
|
||||
method,
|
||||
url,
|
||||
api_error.status_code,
|
||||
api_error.message,
|
||||
f"API {method} request failed with {api_error.status_code} {api_error.message}"
|
||||
)
|
||||
raise api_error from e
|
||||
finally:
|
||||
elapsed_time = time.monotonic() - start_time
|
||||
logger.debug(
|
||||
"API %s request on %s finished in %s", method, url, elapsed_time
|
||||
)
|
||||
logger.debug(f"API {method} request finished in {elapsed_time}")
|
||||
|
||||
def _process_json_response(self, response):
|
||||
try:
|
||||
|
||||
@@ -437,7 +437,6 @@ def test_fetch_monthly_billing_for_year(notify_db_session):
|
||||
results = fetch_monthly_billing_for_year(service.id, 2016)
|
||||
|
||||
assert len(results) == 4 # 3 billed months for each type
|
||||
print(f"RESULTS {results}")
|
||||
|
||||
assert str(results[0].month) == "2016-01-01"
|
||||
assert results[0].notification_type == NotificationType.EMAIL
|
||||
|
||||
@@ -134,22 +134,6 @@ def test_default_template(content):
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("show_banner", [True, False])
|
||||
def test_govuk_banner(show_banner):
|
||||
email = HTMLEmailTemplate(
|
||||
{
|
||||
"content": "hello world",
|
||||
"subject": "",
|
||||
"template_type": "email",
|
||||
}
|
||||
)
|
||||
email.govuk_banner = show_banner
|
||||
if show_banner:
|
||||
assert "beta.notify.gov" in str(email)
|
||||
else:
|
||||
assert "beta.notify.gov" not in str(email)
|
||||
|
||||
|
||||
def test_brand_banner_shows():
|
||||
email = str(
|
||||
HTMLEmailTemplate(
|
||||
|
||||
Reference in New Issue
Block a user