def makeDiscussions(self): for art_num in range(10): catalog_entry = Mock() catalog_entry.total_comments = art_num catalog_entry.getURL = lambda: "http://www.example.com/" discussion_item = Mock() catalog_entry.getObject = lambda: discussion_item discussion_item.getDecoratedTitle = lambda: u"öDecorated Title %i" % art_num yield catalog_entry
def makeReviews(self): for art_num in range(10): cat = Mock() review = Mock() cat.getObject = lambda: review review.get_publication_title = lambda: "Mag Noö: %i" % (art_num / 2) review.getDecoratedTitle = lambda: review.get_publication_title().decode('utf-8') + "Decorated!" review.absolute_url = lambda: "http://www.example.com/" yield cat
def makePresentations(self): content_types = ['Presentation Article Review', 'Presentation Collection', \ 'Presentation Monograph', 'Presentation Online Resource'] for art_num in range(10): catalog_entry = Mock() presentation = Mock() presentation.getDecoratedTitle = lambda:u"öDecorated title no: %i" % art_num catalog_entry.getObject = lambda: presentation catalog_entry.getURL = lambda: 'http://www.example.com/' catalog_entry.portal_type = content_types[art_num % len(content_types)] yield catalog_entry