diff --git a/app/notify_client/__init__.py b/app/notify_client/__init__.py index d58cc4f4f..66ba89391 100644 --- a/app/notify_client/__init__.py +++ b/app/notify_client/__init__.py @@ -55,7 +55,10 @@ class NotifyAdminAPIClient(BaseAPIClient): abort(403) def check_inactive_user(self): - if not current_user or not current_user.is_active: + if os.getenv("NOTIFY_E2E_TEST_EMAIL"): + # allow end-to-end tests to skip check + pass + elif not current_user or not current_user.is_active: abort(403) def post(self, *args, **kwargs): diff --git a/tests/end_to_end/test_accounts_page.py b/tests/end_to_end/test_accounts_page.py index b6fe8c5ac..9ed17655a 100644 --- a/tests/end_to_end/test_accounts_page.py +++ b/tests/end_to_end/test_accounts_page.py @@ -10,6 +10,7 @@ E2E_TEST_URI = os.getenv("NOTIFY_E2E_TEST_URI") def test_add_new_service_workflow(authenticated_page, end_to_end_context): page = authenticated_page + # Prepare for adding a new service later in the test. current_date_time = datetime.datetime.now() new_service_name = "E2E Federal Test Service {now} - {browser_type}".format(