'Create the second translation of a doc.'

@mock.patch.object(ReviewableRevisionInLocaleEvent, 'fire')
@mock.patch.object(EditDocumentEvent, 'fire')
@mock.patch.object(Site.objects, 'get_current')
def test_another_translation_to_locale(self, get_current, edited_fire, ready_fire):

    get_current.return_value.domain = 'testserver'
    rev_es = self._create_and_approve_first_translation()
    rev_enUS = Revision(summary='lipsum', content='lorem    ipsum    dolor    sit    amet    new', significance=SIGNIFICANCES[0][0], keywords='kw1    kw2', document=self.d, creator_id=UserFactory().id, is_ready_for_localization=True, is_approved=True)
    rev_enUS.save()
    url = reverse('wiki.translate', locale='es', args=[self.d.slug])
    response = self.client.get(url)
    doc = pq(response.content)
    eq_(rev_es.content, doc('#id_content').text())
    eq_(rev_enUS.content, doc('#content-fields    textarea[readonly]').text())
    eq_(2, len(doc('.recent-revisions    li')))
    data = _translation_data()
    data['content'] = 'loremo    ipsumo    doloro    sito    ameto    nuevo'
    response = self.client.post(url, data)
    eq_(302, response.status_code)
    eq_('http://testserver/es/kb/un-test-articulo/history', response['location'])
    doc = Document.objects.get(slug=data['slug'])
    rev = doc.revisions.filter(content=data['content'])[0]
    eq_(data['keywords'], rev.keywords)
    eq_(data['summary'], rev.summary)
    eq_(data['content'], rev.content)
    assert (not rev.is_approved)
    assert edited_fire.called
    assert ready_fire.called
