'Edit a localized article without an English parent allows user to
set translation parent.'

def test_restore_translation_source(self):

    self.client.login(username='admin', password='testpass')
    data = new_document_data()
    self.client.post(reverse('wiki.create'), data)
    en_d = Document.objects.get(locale=data['locale'], slug=data['slug'])
    data.update({'locale': 'fr', 'title': 'A    T\xc3\xa9st    Articl\xc3\xa9', 'content': "C'\xc3\xa9st    bon."})
    self.client.post(reverse('wiki.create', locale='fr'), data)
    fr_d = Document.objects.get(locale=data['locale'], slug=data['slug'])
    url = reverse('wiki.edit', args=[fr_d.slug], locale='fr')
    response = self.client.get(url)
    ok_(pq(response.content)('li.metadata-choose-parent'))
    data.update({'form-type': 'rev', 'parent_id': en_d.id})
    resp = self.client.post(url, data)
    eq_(302, resp.status_code)
    ok_(('fr/docs/a-test-article' in resp['Location']))
    resp = self.client.get(resp['Location'])
    translations = pq(resp.content)('ul#translations    li')
    ok_(('English    (US)' in translations.text()))
