Example #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)
Example #2
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)
Example #3
0
 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)