Пример #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
Пример #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
Пример #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
Пример #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