Exemplo n.º 1
0
 def __enter__(self):
     self.old_source = feed_trends.set_ad_source(TestAdSource())
     feed_ads = feed_trends.feed_ads()
     from feed_trends.feed_trends import linkstyle_readmore
     feed_ads.opts = dict(startpos=self.first_ad_index, pinned=False, linkstyle=linkstyle_readmore, css_classes='')
     self.old_append_short_links = feed_ads.append_short_links
     feed_ads.append_short_links = False
Exemplo n.º 2
0
 def __enter__(self):
     self.old_source = feed_trends.set_ad_source(TestAdSource())
     feed_ads = feed_trends.feed_ads()
     from feed_trends.feed_trends import linkstyle_readmore
     feed_ads.opts = dict(startpos=self.first_ad_index,
                          pinned=False,
                          linkstyle=linkstyle_readmore,
                          css_classes='')
     self.old_append_short_links = feed_ads.append_short_links
     feed_ads.append_short_links = False
Exemplo n.º 3
0
 def __exit__(self, type, value, tb):
     feed_trends.set_ad_source(self.old_source)
     feed_trends.feed_ads().append_short_links = self.old_append_short_links
Exemplo n.º 4
0
 def __exit__(self, type, value, tb):
     feed_trends.set_ad_source(self.old_source)
     feed_trends.feed_ads().append_short_links = self.old_append_short_links