'Mark an unapproved revision as ready for l10n must fail.'

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

    r = RevisionFactory(is_approved=False, is_ready_for_localization=False)
    u = UserFactory()
    add_permission(u, Revision, 'mark_ready_for_l10n')
    self.client.login(username=u.username, password='testpass')
    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_(400, response.status_code)
    r2 = Revision.objects.get(pk=r.pk)
    assert (not fire.called)
    assert (not r2.is_ready_for_localization)
