예제 #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)