Example #1
0
 def test_wrong_provider(self):
     """Deal with a wrong provider set on the registry"""
     self.set_up_social_bookmarks(providers=("foo", ))
     viewlet = SocialBookmarksViewlet(self.page, self.request, None)
     viewlet.update()
     html = viewlet.render()
     self.assertFalse("foo" in html)
 def test_wrong_provider(self):
     """ Deal with a wrong provider set on the registry
     """
     self.set_up_social_bookmarks(providers=('foo', ))
     viewlet = SocialBookmarksViewlet(self.page, self.request, None)
     viewlet.update()
     html = viewlet.render()
     self.assertFalse('foo' in html)
Example #3
0
    def test_rendering(self):
        """Validate if Reddit is rendered as an option"""
        viewlet = SocialBookmarksViewlet(self.page, self.request, None)
        viewlet.update()
        html = viewlet.render()
        self.assertTrue("Reddit" in html)

        expected = "http://reddit.com/submit?url=http://nohost"
        self.assertTrue(expected in html)
    def test_rendering(self):
        """ Validate if Reddit is rendered as an option
        """
        viewlet = SocialBookmarksViewlet(self.page, self.request, None)
        viewlet.update()
        html = viewlet.render()
        self.assertTrue('Reddit' in html)

        expected = "http://reddit.com/submit?url=http://nohost"
        self.assertTrue(expected in html)
Example #5
0
    def test_provider_without_url(self):
        """Deal with a provider set without an url template"""
        from plone.registry import field
        from plone.registry.record import Record

        reg = self.reg
        value = {u"url": u"", u"logo": u"", u"id": u"foo"}
        record = Record(field.Dict(title=u"Foo"), value)
        reg.records["sc.social.bookmarks.providers.foo"] = record
        self.set_up_social_bookmarks(providers=("foo", ))
        viewlet = SocialBookmarksViewlet(self.page, self.request, None)
        viewlet.update()
        html = viewlet.render()
        self.assertFalse("foo" in html)
 def test_provider_without_url(self):
     """ Deal with a provider set without an url template
     """
     from plone.registry import field
     from plone.registry.record import Record
     reg = self.reg
     value = {u'url': u'', u'logo': u'', u'id': u'foo'}
     record = Record(field.Dict(title=u"Foo"), value)
     reg.records['sc.social.bookmarks.providers.foo'] = record
     self.set_up_social_bookmarks(providers=('foo', ))
     viewlet = SocialBookmarksViewlet(self.page, self.request, None)
     viewlet.update()
     html = viewlet.render()
     self.assertFalse('foo' in html)