'When an attempt is made to retitle an article, and another article
with that title exists but is a redirect, there should be no errors and
the redirect should be replaced.'

@pytest.mark.clobber
def test_redirect_can_be_clobbered(self):

    self.client.login(username='admin', password='testpass')
    exist_title = 'Existing    doc'
    exist_slug = 'existing-doc'
    changed_title = 'Changed    title'
    changed_slug = 'changed-title'
    data = new_document_data()
    data.update({'title': exist_title, 'slug': exist_slug})
    resp = self.client.post(reverse('wiki.create'), data)
    eq_(302, resp.status_code)
    data.update({'form-type': 'rev', 'title': changed_title, 'slug': changed_slug})
    resp = self.client.post(reverse('wiki.edit', args=[exist_slug]), data)
    eq_(302, resp.status_code)
    data.update({'form-type': 'rev', 'title': exist_title, 'slug': exist_slug})
    resp = self.client.post(reverse('wiki.edit', args=[changed_slug]), data)
    eq_(302, resp.status_code)
