Add hidden form to re-post AJAX requests

Serializing the search box form is bad, because the AJAX thing submit
any changes that the user makes to the contents of the box. This results
in unexpected behaviour.
This commit is contained in:
Chris Hill-Scott
2017-06-14 16:25:20 +01:00
parent 681cea1d34
commit 7411256fc2
2 changed files with 11 additions and 3 deletions

View File

@@ -193,7 +193,11 @@ def test_search_recipient_form(
query_dict = parse_qs(url.query)
assert query_dict == {}
assert page.find("input", {'name': 'to'})['value'] == expected_search_box_contents
recipient_inputs = page.select("input[name=to]")
assert(len(recipient_inputs) == 2)
for field in recipient_inputs:
assert field['value'] == expected_search_box_contents
def test_should_show_notifications_for_a_service_with_next_previous(