'End to end test of locking on a translated document.'

def test_trans_lock_workflow(self):

    rev = ApprovedRevisionFactory()
    doc = rev.document
    u = UserFactory(password='testpass')
    self.client.login(username=u.username, password='testpass')
    trans_url = reverse('wiki.translate', locale='es', args=[doc.slug])
    data = {'title': 'Un    Test    Articulo', 'slug': 'un-test-articulo', 'keywords': 'keyUno,    keyDos,    keyTres', 'summary': 'lipsumo', 'content': 'loremo    ipsumo    doloro    sito    ameto'}
    r = self.client.post(trans_url, data)
    eq_(r.status_code, 302)
    edit_url = reverse('wiki.edit_document', locale='es', args=[data['slug']])
    es_doc = Document.objects.get(slug=data['slug'])
    eq_(es_doc.locale, 'es')
    self._lock_workflow(es_doc, edit_url)
