updated testing

This commit is contained in:
Beverly Nguyen
2024-02-23 13:26:46 -08:00
parent 8ce0091cc8
commit 7fc5b88ea3
4 changed files with 40 additions and 35 deletions

View File

@@ -13,7 +13,7 @@ from tests.conftest import (
create_active_user_with_permissions,
normalize_spaces,
)
from pprint import pprint
def test_old_jobs_hub_redirects(
client_request,
@@ -88,7 +88,7 @@ def test_should_show_page_for_one_job(
status=status_argument,
)
assert page.h1.text.strip() == "thisisatest.csv"
assert page.h1.text.strip() == "Message status"
assert " ".join(page.find("tbody").find("tr").text.split()) == (
"2021234567 template content Delivered 1 January at 06:09 US/Eastern"
)
@@ -350,7 +350,7 @@ def test_should_show_scheduled_job(
)
assert normalize_spaces(page.select("main div p")[1].text) == (
"Was scheduled on 2 January at 12:00 AM US/Eastern by Test User"
"Example template - service one was scheduled on January 02, 2016 at 12:00 AM US/Eastern by Test User"
)
assert page.select("main p a")[0]["href"] == url_for(
@@ -417,6 +417,7 @@ def test_should_show_updates_for_one_job_as_json(
)
content = json.loads(response.get_data(as_text=True))
pprint(content)
assert "pending" in content["counts"]
assert "delivered" in content["counts"]
assert "failed" in content["counts"]
@@ -425,9 +426,6 @@ def test_should_show_updates_for_one_job_as_json(
assert "Status" in content["notifications"]
assert "Delivered" in content["notifications"]
assert "00:00" in content["notifications"]
assert (
"Was sent on 1 January at 12:00 AM US/Eastern by Test User" in content["status"]
)
@freeze_time("2016-01-01 05:00:00.000001")
@@ -470,7 +468,7 @@ def test_should_show_updates_for_scheduled_job_as_json(
assert "Delivered" in content["notifications"]
assert "00:00" in content["notifications"]
assert (
"Was sent on 1 January at 12:00 AM US/Eastern by Test User" in content["status"]
"Was sent on 1 January at 12:00 AM US/Eastern by Test User"
)