Esempio n. 1
0
    def test_interpage(self):
        wiki_page = mommy.make_one(WikiPage, title='test')
        link = LinkTag('test', attrs={'href':'page:test'})
        link.parse()
        assert u'<a href="/wiki/test" class="wiki_link">test</a>' == link.render(), link.render()

        link = LinkTag('test', attrs={'href':'page:test/test2'})
        link.parse()
        assert u'<a href="/wiki/test/test2" class="wiki_link no_wiki_page">test</a>' == link.render(), link.render()
Esempio n. 2
0
 def test_link_attach(self):
     wiki_image = mommy.make_one(WikiAttachement, title='test.zip', attach='test.zip')
     link = LinkTag('test', attrs={'href':'attach:test/test.zip'})
     link.parse()
     assert u'<a href="/media/test.zip" class="wiki_link">test</a>' == link.render(), link.render()
Esempio n. 3
0
 def test_link_image(self):
     wiki_image = mommy.make_one(WikiImage, title='test.jpeg', image='test.jpeg')
     link = LinkTag('test', attrs={'href':'image:test/test.jpeg'})
     link.parse()
     assert u'<a href="/media/test.jpeg" class="wiki_link">test</a>' == link.render(), link.render()
Esempio n. 4
0
 def test_generic(self):
     link = LinkTag('test', attrs={'href':'http://ya.ru'})
     link.parse()
     assert u'<a href="http://ya.ru">test</a>' == link.render()