Пример #1
0
    def test_embedlylink_transformation(self):
        """ Test embedly link transformation """
        portal = self.layer['portal']
        setRoles(portal, TEST_USER_ID, ['Manager'])
        login(portal, TEST_USER_NAME)
        portal.invokeFactory('Document', id='doc')
        portal.doc.setText('<a class="external-link embedlylink" href="%s"></a>' % self.obj_url)

        res = parse(portal.doc.getRawText())
        self.assertTrue(res.startswith('<div class="embed">'))
Пример #2
0
 def test_image(self):
     """ Test image link transformation """
     res = parse('<a class="external-link embedlylink" href="http://www.flickr.com/photos/123.jpg"></a>')
     self.assertTrue(res.startswith('<div class="embed">'))
Пример #3
0
 def test_replace_not_valid_url(self):
     """ Test replace not valid link """
     res = parse('<a class="external-link embedlylink" href="http://not.valid.url/11"></a>')
     self.assertFalse(res.startswith('<div class="embed">'))