'Test Akismet parameters for edited legacy pages.
Keywords and summary are included in the form if the legacy page
includes them.'

@pytest.mark.spam
@requests_mock.mock()
def test_legacy_edit(self, mock_requests):

    legacy_fields = {'keywords': 'CSS,    display', 'summary': 'CSS    property    display'}
    extra_post_data = {'keywords': 'CSS    display,    hidden', 'summary': 'The    CSS    property    display', 'comment': 'Updated'}
    rev_form = self.setup_form(mock_requests, override_original=legacy_fields, override_data=extra_post_data)
    assert rev_form.is_valid()
    parameters = rev_form.akismet_parameters()
    assert (sorted(parameters.keys()) == self.akismet_keys_edit)
    expected_content = ('The    CSS    property    display\n' + '<p>{{cssinfo}}    and    my    changes.</p>\n<p><a    href="http://spam.example.com">Buy    my    product!</a></p>\n<pre    class="brush:css">display:    none;</pre>\nUpdated\nCSS    display,    hidden')
    assert (parameters['comment_content'] == expected_content)
