def test_get_results_from_search_response_xss(retrieve_profile_data):
    response = core.tests.helpers.create_response(json_payload={'hits': {'total': 1, 'hits': [{'_source': retrieve_profile_data, 'highlight': {'description': ['<a onmouseover=javascript:func()>stuff</a>', 'to the max <em>wolf</em>.']}}]}})
    formatted = helpers.get_results_from_search_response(response)
    assert (formatted['results'][0]['highlight'] == '&lt;a onmouseover=javascript:func()&gt;stuff&lt;/a&gt;...to the max <em>wolf</em>.')
def test_get_results_from_search_response_xss(retrieve_profile_data):
    response = core.tests.helpers.create_response(json_payload={'hits': {'total': 1, 'hits': [{'_source': retrieve_profile_data, 'highlight': {'description': ['<a onmouseover=javascript:func()>stuff</a>', 'to the max <em>wolf</em>.']}}]}})
    formatted = helpers.get_results_from_search_response(response)
    assert (formatted['results'][0]['highlight'] == '&lt;a onmouseover=javascript:func()&gt;stuff&lt;/a&gt;...to the max <em>wolf</em>.')