'HTTP POST to mark a revision as ready for l10n.'

@mock.patch.object(ReadyRevisionEvent, 'fire')
def test_mark_as_ready_POST(self, fire):

    u = UserFactory()
    add_permission(u, Revision, 'mark_ready_for_l10n')
    self.client.login(username=u.username, password='testpass')
    r = ApprovedRevisionFactory(is_ready_for_localization=False, significance=MEDIUM_SIGNIFICANCE)
    url = reverse('wiki.mark_ready_for_l10n_revision', args=[r.document.slug, r.id])
    response = self.client.post(url, data={}, HTTP_X_REQUESTED_WITH='XMLHttpRequest')
    eq_(200, response.status_code)
    r2 = Revision.objects.get(pk=r.pk)
    assert fire.called
    assert r2.is_ready_for_localization
    assert r2.readied_for_localization
    eq_(r2.readied_for_localization_by, u)
    eq_(r2.document.latest_localizable_revision, r2)
