mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-24 16:24:08 -04:00
Merge pull request #1387 from alphagov/fix-breaking-change-python-client
Fix things that broke when I merged Pyup’s changes
This commit is contained in:
@@ -55,8 +55,14 @@ def test_letters_lets_in_without_permission(
|
||||
|
||||
|
||||
@pytest.mark.parametrize('permissions, choices', [
|
||||
(['email', 'sms', 'letter'], ['Email', 'Text message', 'Letter']),
|
||||
(['email', 'sms'], ['Email', 'Text message'])
|
||||
(
|
||||
['email', 'sms', 'letter'],
|
||||
['Email', 'Text message', 'Letter']
|
||||
),
|
||||
(
|
||||
['email', 'sms'],
|
||||
['Email', 'Text message']
|
||||
),
|
||||
])
|
||||
def test_given_option_to_add_letters_if_allowed(
|
||||
logged_in_client,
|
||||
@@ -73,8 +79,13 @@ def test_given_option_to_add_letters_if_allowed(
|
||||
assert response.status_code == 200
|
||||
page = BeautifulSoup(response.data.decode('utf-8'), 'html.parser')
|
||||
radios = page.select('input[type=radio]')
|
||||
labels = page.select('label')
|
||||
|
||||
assert len(radios) == len(choices)
|
||||
assert len(labels) == len(choices)
|
||||
|
||||
for index, choice in enumerate(choices):
|
||||
assert radios[index].text.strip() == choice
|
||||
for index, choice in enumerate(permissions):
|
||||
assert radios[index]['value'] == choice
|
||||
|
||||
for index, label in enumerate(choices):
|
||||
assert labels[index].text.strip() == label
|
||||
|
||||
@@ -206,7 +206,7 @@ def test_escapes_letter_contact_block(
|
||||
|
||||
page = BeautifulSoup(response.data.decode('utf-8'), 'html.parser')
|
||||
div = str(page.find_all('tr')[5].find_all('td')[1].div)
|
||||
assert 'foo<br>bar' in div
|
||||
assert 'foo<br/>bar' in div
|
||||
assert '<script>' not in div
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user