mirror of
https://github.com/GSA/notifications-admin.git
synced 2025-12-08 22:24:22 -05:00
get rid of some noise in status updates
This commit is contained in:
@@ -555,7 +555,7 @@
|
||||
"filename": "tests/app/main/views/test_register.py",
|
||||
"hashed_secret": "5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8",
|
||||
"is_verified": false,
|
||||
"line_number": 200,
|
||||
"line_number": 199,
|
||||
"is_secret": false
|
||||
},
|
||||
{
|
||||
@@ -563,7 +563,7 @@
|
||||
"filename": "tests/app/main/views/test_register.py",
|
||||
"hashed_secret": "bb5b7caa27d005d38039e3797c3ddb9bcd22c3c8",
|
||||
"is_verified": false,
|
||||
"line_number": 273,
|
||||
"line_number": 272,
|
||||
"is_secret": false
|
||||
}
|
||||
],
|
||||
@@ -684,5 +684,5 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"generated_at": "2025-01-13T20:16:58Z"
|
||||
"generated_at": "2025-01-16T16:38:48Z"
|
||||
}
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
import json
|
||||
|
||||
from app.extensions import redis_client
|
||||
from app.notify_client import NotifyAdminAPIClient
|
||||
|
||||
|
||||
@@ -15,10 +18,19 @@ class BillingAPIClient(NotifyAdminAPIClient):
|
||||
)
|
||||
|
||||
def get_free_sms_fragment_limit_for_year(self, service_id, year=None):
|
||||
frag_limit = redis_client.get(f"free-sms-fragment-limit-{service_id}-{year}")
|
||||
if frag_limit is not None:
|
||||
return json.loads(frag_limit.decode("utf-8"))
|
||||
result = self.get(
|
||||
"/service/{0}/billing/free-sms-fragment-limit".format(service_id),
|
||||
params=dict(financial_year_start=year),
|
||||
)
|
||||
|
||||
redis_client.set(
|
||||
f"free-sms-fragment-limit-{service_id}-{year}",
|
||||
json.dumps(result["free_sms_fragment_limit"]),
|
||||
ex=30,
|
||||
)
|
||||
return result["free_sms_fragment_limit"]
|
||||
|
||||
def create_or_update_free_sms_fragment_limit(
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import json
|
||||
from datetime import datetime, timezone
|
||||
|
||||
from app.extensions import redis_client
|
||||
@@ -517,7 +518,18 @@ class ServiceAPIClient(NotifyAdminAPIClient):
|
||||
return int(count)
|
||||
|
||||
def get_global_notification_count(self, service_id):
|
||||
return self.get("/service/{}/notification-count".format(service_id))
|
||||
notification_count = redis_client.get(f"notification-count-{service_id}")
|
||||
if notification_count is not None:
|
||||
return json.loads(notification_count.decode("utf-8"))
|
||||
|
||||
notification_count = self.get(
|
||||
"/service/{}/notification-count".format(service_id)
|
||||
)
|
||||
redis_client.set(
|
||||
f"notification-count-{service_id}", json.dumps(notification_count), ex=30
|
||||
)
|
||||
|
||||
return notification_count
|
||||
|
||||
def get_service_invite_data(self, redis_key):
|
||||
"""
|
||||
|
||||
@@ -122,9 +122,7 @@ def test_static_pages(client_request, mock_get_organization_by_domain, view, moc
|
||||
session["user_id"] = None
|
||||
request(
|
||||
_expected_status=302,
|
||||
_expected_redirect="/sign-in?next={}".format(
|
||||
url_for("main.{}".format(view))
|
||||
),
|
||||
_expected_redirect="/sign-in?next={}".format(url_for("main.{}".format(view))),
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -144,9 +144,8 @@ def test_should_return_200_when_email_is_not_gov_uk(
|
||||
_expected_status=200,
|
||||
)
|
||||
|
||||
assert (
|
||||
"Enter a public sector email address."
|
||||
in normalize_spaces(page.select_one(".usa-error-message").text)
|
||||
assert "Enter a public sector email address." in normalize_spaces(
|
||||
page.select_one(".usa-error-message").text
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user