'Create the second translation of a doc.'

@mock.patch.object(EditDocumentEvent, 'fire')
@mock.patch.object(Site.objects, 'get_current')
def test_another_translation_to_locale(self, get_current, edited_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', keywords='kw1    kw2', document=self.d, creator_id=8, is_approved=True)
    rev_enUS.save()
    translate_uri = self._translate_uri()
    response = self.client.get(translate_uri)
    doc = pq(response.content)
    eq_(rev_es.content, doc('#id_content').text())
    eq_(rev_enUS.content, doc('article.approved    .translate-rendered').text())
    data = _translation_data()
    data['content'] = 'loremo    ipsumo    doloro    sito    ameto    nuevo'
    response = self.client.post(translate_uri, data)
    eq_(302, response.status_code)
    eq_('http://testserver/es/docs/un-test-articulo?rev_saved=', 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)
    ok_(edited_fire.called)
    self.client.logout()
    self.client.login(username='testuser', password='testpass')
    response = self.client.get(translate_uri)
    doc = pq(response.content)
    eq_(0, len(doc('form    input[name="slug"]')))
