mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-11 18:37:33 -04:00
fix tests for new platform admin layout
This commit is contained in:
@@ -245,13 +245,13 @@ def test_should_show_archived_services_last(
|
|||||||
assert response.status_code == 200
|
assert response.status_code == 200
|
||||||
mock_get_detailed_services.assert_called_once_with({'detailed': True})
|
mock_get_detailed_services.assert_called_once_with({'detailed': True})
|
||||||
page = BeautifulSoup(response.data.decode('utf-8'), 'html.parser')
|
page = BeautifulSoup(response.data.decode('utf-8'), 'html.parser')
|
||||||
rows = page.find_all('tbody')[table_index].find_all('tr')
|
|
||||||
assert len(rows)
|
table_body = page.find_all('table')[table_index].find_all('tbody')[0]
|
||||||
assert rows[0]
|
services = [service.tr for service in table_body.find_all('tbody')]
|
||||||
assert rows[1]
|
assert len(services) == 3
|
||||||
assert rows[0].td.text.strip() == 'A'
|
assert services[0].td.text.strip() == 'A'
|
||||||
assert rows[1].td.text.strip() == 'B'
|
assert services[1].td.text.strip() == 'B'
|
||||||
assert rows[2].td.text.strip() == 'C'
|
assert services[2].td.text.strip() == 'C'
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize('research_mode', (True, False))
|
@pytest.mark.parametrize('research_mode', (True, False))
|
||||||
@@ -274,6 +274,8 @@ def test_shows_archived_label_instead_of_live_or_research_mode_label(
|
|||||||
|
|
||||||
assert response.status_code == 200
|
assert response.status_code == 200
|
||||||
page = BeautifulSoup(response.data.decode('utf-8'), 'html.parser')
|
page = BeautifulSoup(response.data.decode('utf-8'), 'html.parser')
|
||||||
flags = page.find_all('tbody')[0].tr.find_all('td')[1]
|
|
||||||
|
table_body = page.find_all('table')[0].find_all('tbody')[0]
|
||||||
|
service_mode = table_body.find_all('tbody')[0].find_all('tr')[1].td.text.strip()
|
||||||
# get second column, which contains flags as text.
|
# get second column, which contains flags as text.
|
||||||
assert flags.text.strip() == 'archived'
|
assert service_mode == 'archived'
|
||||||
|
|||||||
Reference in New Issue
Block a user