'Link to a wiki page with caption and frame.'

def test_page_link_caption(self):

    img_div = pq_img(self.p, '[[Image:test.jpg|frame|page=A    page|my    caption]]', 'div.img')
    img_a = img_div('a')
    img = img_a('img')
    caption = img_div.text()
    eq_('my    caption', img.attr('alt'))
    eq_('my    caption', caption)
    eq_(self.img.file.url, img.attr('src'))
    assert img_a.hasClass('new')
    eq_('/en-US/kb/new?title=A+page', img_a.attr('href'))
