Пример #1
0
    def causes_the_same_content_feed_to_be_returned_on_different_calls_to_getFeed(self):
        library = ContentFeedLibrary(shared=False)
        library.register(ListItemFeed, 'li')

        feed = ListItemFeed('[1, 2, 3]')
        record = library.get_record(feed)

        assert_is(feed, library.get_feed(record))
Пример #2
0
    def causes_the_same_content_feed_to_be_returned_on_different_calls_to_getFeed(self):
        library = ContentFeedLibrary(shared=False)
        library.register(ListItemFeed, 'li')

        feed = ListItemFeed('[1, 2, 3]')
        record = library.get_record(feed)

        assert_is(feed, library.get_feed(record))
Пример #3
0
    def doesnt_return_the_same_feed_from_different_libraries(self):
        library1 = ContentFeedLibrary(shared=False)
        library1.register(ListItemFeed, 'li')

        library2 = ContentFeedLibrary(shared=False)
        library2.register(ListItemFeed, 'li')

        feed = ListItemFeed('[1, 2, 3]')
        record = library1.get_record(feed)

        assert_is_not(feed, library2.get_feed(record))
Пример #4
0
    def doesnt_return_the_same_feed_from_different_libraries(self):
        library1 = ContentFeedLibrary(shared=False)
        library1.register(ListItemFeed, 'li')

        library2 = ContentFeedLibrary(shared=False)
        library2.register(ListItemFeed, 'li')

        feed = ListItemFeed('[1, 2, 3]')
        record = library1.get_record(feed)

        assert_is_not(feed, library2.get_feed(record))
def subscription_title(subscription, library=None):
    if library is None:
        library = ContentFeedLibrary()
    
    feed = library.get_feed(subscription.feed_record)
    return feed.get_label()