示例#1
0
def get_nsfw_collections_srnames():
    all_collections = Collection.get_all()
    nsfw_collections = [col for col in all_collections if col.over_18]
    srnames = itertools.chain.from_iterable(col.sr_names
                                            for col in nsfw_collections)

    return set(srnames)
示例#2
0
文件: promote.py 项目: pra85/reddit
def get_nsfw_collections_srnames():
    all_collections = Collection.get_all()
    nsfw_collections = [col for col in all_collections if col.over_18]
    srnames = itertools.chain.from_iterable(
        col.sr_names for col in nsfw_collections
    )

    return set(srnames)
示例#3
0
文件: promo_test.py 项目: z0r0/saidit
 def _assert_scenario(self, unordered_collections):
     CollectionStorage.get_all.return_value = unordered_collections
     self.assertEqual(
         [collection.name for collection in Collection.get_all()],
         self.correct_order)