'Make sure internal links work correctly when not to redirected
articles and when to redirected articles'

def test_internal_links(self):

    p = WikiParser()
    rev = ApprovedRevisionFactory()
    doc = rev.document
    doc.current_revision = rev
    doc.title = 'Real    article'
    doc.save()
    old_slug = doc.slug
    doc.slug = 'real-article'
    doc.save()
    redirect = Document.objects.get(slug=old_slug)
    eq_(p.parse(('[[%s]]' % doc.title)), ('<p><a    href="/en-US/kb/%s">%s</a>\n</p>' % (doc.slug, doc.title)))
    eq_(p.parse(('[[%s]]' % redirect.title)), ('<p><a    href="/en-US/kb/%s">%s</a>\n</p>' % (doc.slug, doc.title)))
