'Make sure we can save a document with translations.'

def test_can_save_document_with_translations(self):

    _create_document(title='Document    Prueba', parent=self.d, locale='es')
    response = get(self.client, 'wiki.edit_document', args=[self.d.slug])
    eq_(200, response.status_code)
    doc = pq(response.content)
    is_localizable = doc('input[name="is_localizable"]')
    eq_(1, len(is_localizable))
    eq_('True', is_localizable[0].attrib['value'])
    data = new_document_data()
    new_title = 'A    brand    new    title'
    data.update(title=new_title)
    data.update(form='doc')
    data.update(is_localizable='True')
    response = post(self.client, 'wiki.edit_document', data, args=[self.d.slug])
    eq_(200, response.status_code)
    doc = Document.objects.get(pk=self.d.pk)
    eq_(new_title, doc.title)
