diff --git a/src/newsreader/news/collection/tests/reddit/builder/mocks.py b/src/newsreader/news/collection/tests/reddit/builder/mocks.py index 1ca3a50..e163e44 100644 --- a/src/newsreader/news/collection/tests/reddit/builder/mocks.py +++ b/src/newsreader/news/collection/tests/reddit/builder/mocks.py @@ -1717,366 +1717,7 @@ image_mock = { "children": [ { "data": { - "all_awardings": [ - { - "award_sub_type": "COMMUNITY", - "award_type": "community", - "coin_price": 1000, - "coin_reward": 0, - "count": 1, - "days_of_drip_extension": 0, - "days_of_premium": 0, - "description": "Shows the " - "Explodey " - "Heart " - "Award and " - "grants " - "%{coin_symbol}200 " - "Coins to " - "the " - "community. " - "Exclusive " - "to this " - "community.", - "end_date": None, - "giver_coin_reward": None, - "icon_format": None, - "icon_height": 512, - "icon_url": "https://i.redd.it/award_images/t5_2qh1o/ootzpllhcnf31_ExplodeyHeart.png", - "icon_width": 512, - "id": "award_c34abea5-6327-42d7-b2ff-6d9094d44f4c", - "is_enabled": True, - "is_new": False, - "name": "Explodey Heart", - "penny_donate": None, - "penny_price": None, - "resized_icons": [ - { - "height": 16, - "url": "https://preview.redd.it/award_images/t5_2qh1o/ootzpllhcnf31_ExplodeyHeart.png?width=16&height=16&auto=webp&s=3b66957dc7f12e811570571101c0b63851b9ad08", - "width": 16, - }, - { - "height": 32, - "url": "https://preview.redd.it/award_images/t5_2qh1o/ootzpllhcnf31_ExplodeyHeart.png?width=32&height=32&auto=webp&s=656f3afab067a81dc0d9184c3d8990d4107261fd", - "width": 32, - }, - { - "height": 48, - "url": "https://preview.redd.it/award_images/t5_2qh1o/ootzpllhcnf31_ExplodeyHeart.png?width=48&height=48&auto=webp&s=4632233b3b7cb1aaebdc822935f907704992a3da", - "width": 48, - }, - { - "height": 64, - "url": "https://preview.redd.it/award_images/t5_2qh1o/ootzpllhcnf31_ExplodeyHeart.png?width=64&height=64&auto=webp&s=b1f187afa44d92db51623b706712dc5d99421909", - "width": 64, - }, - { - "height": 128, - "url": "https://preview.redd.it/award_images/t5_2qh1o/ootzpllhcnf31_ExplodeyHeart.png?width=128&height=128&auto=webp&s=1ea36ba8545e50a098c7d6c6f854243e0ff6dfbe", - "width": 128, - }, - ], - "resized_static_icons": [ - { - "height": 16, - "url": "https://preview.redd.it/award_images/t5_2qh1o/ootzpllhcnf31_ExplodeyHeart.png?width=16&height=16&auto=webp&s=3b66957dc7f12e811570571101c0b63851b9ad08", - "width": 16, - }, - { - "height": 32, - "url": "https://preview.redd.it/award_images/t5_2qh1o/ootzpllhcnf31_ExplodeyHeart.png?width=32&height=32&auto=webp&s=656f3afab067a81dc0d9184c3d8990d4107261fd", - "width": 32, - }, - { - "height": 48, - "url": "https://preview.redd.it/award_images/t5_2qh1o/ootzpllhcnf31_ExplodeyHeart.png?width=48&height=48&auto=webp&s=4632233b3b7cb1aaebdc822935f907704992a3da", - "width": 48, - }, - { - "height": 64, - "url": "https://preview.redd.it/award_images/t5_2qh1o/ootzpllhcnf31_ExplodeyHeart.png?width=64&height=64&auto=webp&s=b1f187afa44d92db51623b706712dc5d99421909", - "width": 64, - }, - { - "height": 128, - "url": "https://preview.redd.it/award_images/t5_2qh1o/ootzpllhcnf31_ExplodeyHeart.png?width=128&height=128&auto=webp&s=1ea36ba8545e50a098c7d6c6f854243e0ff6dfbe", - "width": 128, - }, - ], - "start_date": None, - "static_icon_height": 512, - "static_icon_url": "https://i.redd.it/award_images/t5_2qh1o/ootzpllhcnf31_ExplodeyHeart.png", - "static_icon_width": 512, - "subreddit_coin_reward": 200, - "subreddit_id": "t5_2qh1o", - }, - { - "award_sub_type": "GLOBAL", - "award_type": "global", - "coin_price": 500, - "coin_reward": 100, - "count": 1, - "days_of_drip_extension": 0, - "days_of_premium": 7, - "description": "Gives the " - "author a " - "week of " - "Reddit " - "Premium, " - "%{coin_symbol}100 " - "Coins to " - "do with as " - "they " - "please, " - "and shows " - "a Gold " - "Award.", - "end_date": None, - "giver_coin_reward": None, - "icon_format": None, - "icon_height": 512, - "icon_url": "https://www.redditstatic.com/gold/awards/icon/gold_512.png", - "icon_width": 512, - "id": "gid_2", - "is_enabled": True, - "is_new": False, - "name": "Gold", - "penny_donate": None, - "penny_price": None, - "resized_icons": [ - { - "height": 16, - "url": "https://www.redditstatic.com/gold/awards/icon/gold_16.png", - "width": 16, - }, - { - "height": 32, - "url": "https://www.redditstatic.com/gold/awards/icon/gold_32.png", - "width": 32, - }, - { - "height": 48, - "url": "https://www.redditstatic.com/gold/awards/icon/gold_48.png", - "width": 48, - }, - { - "height": 64, - "url": "https://www.redditstatic.com/gold/awards/icon/gold_64.png", - "width": 64, - }, - { - "height": 128, - "url": "https://www.redditstatic.com/gold/awards/icon/gold_128.png", - "width": 128, - }, - ], - "resized_static_icons": [ - { - "height": 16, - "url": "https://www.redditstatic.com/gold/awards/icon/gold_16.png", - "width": 16, - }, - { - "height": 32, - "url": "https://www.redditstatic.com/gold/awards/icon/gold_32.png", - "width": 32, - }, - { - "height": 48, - "url": "https://www.redditstatic.com/gold/awards/icon/gold_48.png", - "width": 48, - }, - { - "height": 64, - "url": "https://www.redditstatic.com/gold/awards/icon/gold_64.png", - "width": 64, - }, - { - "height": 128, - "url": "https://www.redditstatic.com/gold/awards/icon/gold_128.png", - "width": 128, - }, - ], - "start_date": None, - "static_icon_height": 512, - "static_icon_url": "https://www.redditstatic.com/gold/awards/icon/gold_512.png", - "static_icon_width": 512, - "subreddit_coin_reward": 0, - "subreddit_id": None, - }, - { - "award_sub_type": "GLOBAL", - "award_type": "global", - "coin_price": 125, - "coin_reward": 0, - "count": 1, - "days_of_drip_extension": 0, - "days_of_premium": 0, - "description": "When you " - "come " - "across a " - "feel-good " - "thing.", - "end_date": None, - "giver_coin_reward": None, - "icon_format": None, - "icon_height": 2048, - "icon_url": "https://i.redd.it/award_images/t5_22cerq/5izbv4fn0md41_Wholesome.png", - "icon_width": 2048, - "id": "award_5f123e3d-4f48-42f4-9c11-e98b566d5897", - "is_enabled": True, - "is_new": False, - "name": "Wholesome", - "penny_donate": None, - "penny_price": None, - "resized_icons": [ - { - "height": 16, - "url": "https://preview.redd.it/award_images/t5_22cerq/5izbv4fn0md41_Wholesome.png?width=16&height=16&auto=webp&s=92932f465d58e4c16b12b6eac4ca07d27e3d11c0", - "width": 16, - }, - { - "height": 32, - "url": "https://preview.redd.it/award_images/t5_22cerq/5izbv4fn0md41_Wholesome.png?width=32&height=32&auto=webp&s=d11484a208d68a318bf9d4fcf371171a1cb6a7ef", - "width": 32, - }, - { - "height": 48, - "url": "https://preview.redd.it/award_images/t5_22cerq/5izbv4fn0md41_Wholesome.png?width=48&height=48&auto=webp&s=febdf28b6f39f7da7eb1365325b85e0bb49a9f63", - "width": 48, - }, - { - "height": 64, - "url": "https://preview.redd.it/award_images/t5_22cerq/5izbv4fn0md41_Wholesome.png?width=64&height=64&auto=webp&s=b4406a2d88bf86fa3dc8a45aacf7e0c7bdccc4fb", - "width": 64, - }, - { - "height": 128, - "url": "https://preview.redd.it/award_images/t5_22cerq/5izbv4fn0md41_Wholesome.png?width=128&height=128&auto=webp&s=19555b13e3e196b62eeb9160d1ac1d1b372dcb0b", - "width": 128, - }, - ], - "resized_static_icons": [ - { - "height": 16, - "url": "https://preview.redd.it/award_images/t5_22cerq/5izbv4fn0md41_Wholesome.png?width=16&height=16&auto=webp&s=92932f465d58e4c16b12b6eac4ca07d27e3d11c0", - "width": 16, - }, - { - "height": 32, - "url": "https://preview.redd.it/award_images/t5_22cerq/5izbv4fn0md41_Wholesome.png?width=32&height=32&auto=webp&s=d11484a208d68a318bf9d4fcf371171a1cb6a7ef", - "width": 32, - }, - { - "height": 48, - "url": "https://preview.redd.it/award_images/t5_22cerq/5izbv4fn0md41_Wholesome.png?width=48&height=48&auto=webp&s=febdf28b6f39f7da7eb1365325b85e0bb49a9f63", - "width": 48, - }, - { - "height": 64, - "url": "https://preview.redd.it/award_images/t5_22cerq/5izbv4fn0md41_Wholesome.png?width=64&height=64&auto=webp&s=b4406a2d88bf86fa3dc8a45aacf7e0c7bdccc4fb", - "width": 64, - }, - { - "height": 128, - "url": "https://preview.redd.it/award_images/t5_22cerq/5izbv4fn0md41_Wholesome.png?width=128&height=128&auto=webp&s=19555b13e3e196b62eeb9160d1ac1d1b372dcb0b", - "width": 128, - }, - ], - "start_date": None, - "static_icon_height": 2048, - "static_icon_url": "https://i.redd.it/award_images/t5_22cerq/5izbv4fn0md41_Wholesome.png", - "static_icon_width": 2048, - "subreddit_coin_reward": 0, - "subreddit_id": None, - }, - { - "award_sub_type": "GLOBAL", - "award_type": "global", - "coin_price": 75, - "coin_reward": 0, - "count": 1, - "days_of_drip_extension": 0, - "days_of_premium": 0, - "description": "Everything's " - "better " - "with a " - "good hug", - "end_date": None, - "giver_coin_reward": 0, - "icon_format": "PNG", - "icon_height": 2048, - "icon_url": "https://i.redd.it/award_images/t5_22cerq/5smbysczm1w41_Hugz.png", - "icon_width": 2048, - "id": "award_ce5f9ce6-49d9-4905-9228-22950e889206", - "is_enabled": True, - "is_new": False, - "name": "Hugz", - "penny_donate": 0, - "penny_price": 0, - "resized_icons": [ - { - "height": 16, - "url": "https://preview.redd.it/award_images/t5_22cerq/5smbysczm1w41_Hugz.png?width=16&height=16&auto=webp&s=7a3164ef705ae0a41198e29767e4a51fd86e2dcd", - "width": 16, - }, - { - "height": 32, - "url": "https://preview.redd.it/award_images/t5_22cerq/5smbysczm1w41_Hugz.png?width=32&height=32&auto=webp&s=5c621179e63f7f6fbb6a0807367bd79467878784", - "width": 32, - }, - { - "height": 48, - "url": "https://preview.redd.it/award_images/t5_22cerq/5smbysczm1w41_Hugz.png?width=48&height=48&auto=webp&s=ebf40f79a711e9c4206f5f841235e43697f7a3f5", - "width": 48, - }, - { - "height": 64, - "url": "https://preview.redd.it/award_images/t5_22cerq/5smbysczm1w41_Hugz.png?width=64&height=64&auto=webp&s=18dad26bb669e202c42ff6b742d6c0f9d1e62ee9", - "width": 64, - }, - { - "height": 128, - "url": "https://preview.redd.it/award_images/t5_22cerq/5smbysczm1w41_Hugz.png?width=128&height=128&auto=webp&s=61ccae2b32cfbf2f26bd53c9d1287d1235da4d68", - "width": 128, - }, - ], - "resized_static_icons": [ - { - "height": 16, - "url": "https://preview.redd.it/award_images/t5_22cerq/5smbysczm1w41_Hugz.png?width=16&height=16&auto=webp&s=7a3164ef705ae0a41198e29767e4a51fd86e2dcd", - "width": 16, - }, - { - "height": 32, - "url": "https://preview.redd.it/award_images/t5_22cerq/5smbysczm1w41_Hugz.png?width=32&height=32&auto=webp&s=5c621179e63f7f6fbb6a0807367bd79467878784", - "width": 32, - }, - { - "height": 48, - "url": "https://preview.redd.it/award_images/t5_22cerq/5smbysczm1w41_Hugz.png?width=48&height=48&auto=webp&s=ebf40f79a711e9c4206f5f841235e43697f7a3f5", - "width": 48, - }, - { - "height": 64, - "url": "https://preview.redd.it/award_images/t5_22cerq/5smbysczm1w41_Hugz.png?width=64&height=64&auto=webp&s=18dad26bb669e202c42ff6b742d6c0f9d1e62ee9", - "width": 64, - }, - { - "height": 128, - "url": "https://preview.redd.it/award_images/t5_22cerq/5smbysczm1w41_Hugz.png?width=128&height=128&auto=webp&s=61ccae2b32cfbf2f26bd53c9d1287d1235da4d68", - "width": 128, - }, - ], - "start_date": None, - "static_icon_height": 2048, - "static_icon_url": "https://i.redd.it/award_images/t5_22cerq/5smbysczm1w41_Hugz.png", - "static_icon_width": 2048, - "subreddit_coin_reward": 0, - "subreddit_id": None, - }, - ], + "all_awardings": [], "allow_live_comments": True, "approved_at_utc": None, "approved_by": None, @@ -2236,180 +1877,7 @@ image_mock = { }, { "data": { - "all_awardings": [ - { - "award_sub_type": "GLOBAL", - "award_type": "global", - "coin_price": 125, - "coin_reward": 0, - "count": 1, - "days_of_drip_extension": 0, - "days_of_premium": 0, - "description": "When you " - "come " - "across a " - "feel-good " - "thing.", - "end_date": None, - "giver_coin_reward": None, - "icon_format": None, - "icon_height": 2048, - "icon_url": "https://i.redd.it/award_images/t5_22cerq/5izbv4fn0md41_Wholesome.png", - "icon_width": 2048, - "id": "award_5f123e3d-4f48-42f4-9c11-e98b566d5897", - "is_enabled": True, - "is_new": False, - "name": "Wholesome", - "penny_donate": None, - "penny_price": None, - "resized_icons": [ - { - "height": 16, - "url": "https://preview.redd.it/award_images/t5_22cerq/5izbv4fn0md41_Wholesome.png?width=16&height=16&auto=webp&s=92932f465d58e4c16b12b6eac4ca07d27e3d11c0", - "width": 16, - }, - { - "height": 32, - "url": "https://preview.redd.it/award_images/t5_22cerq/5izbv4fn0md41_Wholesome.png?width=32&height=32&auto=webp&s=d11484a208d68a318bf9d4fcf371171a1cb6a7ef", - "width": 32, - }, - { - "height": 48, - "url": "https://preview.redd.it/award_images/t5_22cerq/5izbv4fn0md41_Wholesome.png?width=48&height=48&auto=webp&s=febdf28b6f39f7da7eb1365325b85e0bb49a9f63", - "width": 48, - }, - { - "height": 64, - "url": "https://preview.redd.it/award_images/t5_22cerq/5izbv4fn0md41_Wholesome.png?width=64&height=64&auto=webp&s=b4406a2d88bf86fa3dc8a45aacf7e0c7bdccc4fb", - "width": 64, - }, - { - "height": 128, - "url": "https://preview.redd.it/award_images/t5_22cerq/5izbv4fn0md41_Wholesome.png?width=128&height=128&auto=webp&s=19555b13e3e196b62eeb9160d1ac1d1b372dcb0b", - "width": 128, - }, - ], - "resized_static_icons": [ - { - "height": 16, - "url": "https://preview.redd.it/award_images/t5_22cerq/5izbv4fn0md41_Wholesome.png?width=16&height=16&auto=webp&s=92932f465d58e4c16b12b6eac4ca07d27e3d11c0", - "width": 16, - }, - { - "height": 32, - "url": "https://preview.redd.it/award_images/t5_22cerq/5izbv4fn0md41_Wholesome.png?width=32&height=32&auto=webp&s=d11484a208d68a318bf9d4fcf371171a1cb6a7ef", - "width": 32, - }, - { - "height": 48, - "url": "https://preview.redd.it/award_images/t5_22cerq/5izbv4fn0md41_Wholesome.png?width=48&height=48&auto=webp&s=febdf28b6f39f7da7eb1365325b85e0bb49a9f63", - "width": 48, - }, - { - "height": 64, - "url": "https://preview.redd.it/award_images/t5_22cerq/5izbv4fn0md41_Wholesome.png?width=64&height=64&auto=webp&s=b4406a2d88bf86fa3dc8a45aacf7e0c7bdccc4fb", - "width": 64, - }, - { - "height": 128, - "url": "https://preview.redd.it/award_images/t5_22cerq/5izbv4fn0md41_Wholesome.png?width=128&height=128&auto=webp&s=19555b13e3e196b62eeb9160d1ac1d1b372dcb0b", - "width": 128, - }, - ], - "start_date": None, - "static_icon_height": 2048, - "static_icon_url": "https://i.redd.it/award_images/t5_22cerq/5izbv4fn0md41_Wholesome.png", - "static_icon_width": 2048, - "subreddit_coin_reward": 0, - "subreddit_id": None, - }, - { - "award_sub_type": "GLOBAL", - "award_type": "global", - "coin_price": 50, - "coin_reward": 0, - "count": 1, - "days_of_drip_extension": 0, - "days_of_premium": 0, - "description": "Listen, " - "get " - "educated, " - "and get " - "involved.", - "end_date": None, - "giver_coin_reward": 0, - "icon_format": "PNG", - "icon_height": 2048, - "icon_url": "https://i.redd.it/award_images/t5_22cerq/5nswjpyy44551_Ally.png", - "icon_width": 2048, - "id": "award_69c94eb4-d6a3-48e7-9cf2-0f39fed8b87c", - "is_enabled": True, - "is_new": False, - "name": "Ally", - "penny_donate": 0, - "penny_price": 0, - "resized_icons": [ - { - "height": 16, - "url": "https://preview.redd.it/award_images/t5_22cerq/5nswjpyy44551_Ally.png?width=16&height=16&auto=webp&s=bb033b3352b6ece0954d279a56f99e16c67abe14", - "width": 16, - }, - { - "height": 32, - "url": "https://preview.redd.it/award_images/t5_22cerq/5nswjpyy44551_Ally.png?width=32&height=32&auto=webp&s=a8e1d0c2994e6e0b254fab1611d539a4fb94e38a", - "width": 32, - }, - { - "height": 48, - "url": "https://preview.redd.it/award_images/t5_22cerq/5nswjpyy44551_Ally.png?width=48&height=48&auto=webp&s=723e4e932c9692ac61cf5b7509424c6ae1b5d220", - "width": 48, - }, - { - "height": 64, - "url": "https://preview.redd.it/award_images/t5_22cerq/5nswjpyy44551_Ally.png?width=64&height=64&auto=webp&s=b7f0640e403ac0ef31236a4a0b7f3dc25de6046c", - "width": 64, - }, - { - "height": 128, - "url": "https://preview.redd.it/award_images/t5_22cerq/5nswjpyy44551_Ally.png?width=128&height=128&auto=webp&s=ac954bb1a06af66bf9295bbfee4550443fb6f21d", - "width": 128, - }, - ], - "resized_static_icons": [ - { - "height": 16, - "url": "https://preview.redd.it/award_images/t5_22cerq/5nswjpyy44551_Ally.png?width=16&height=16&auto=webp&s=bb033b3352b6ece0954d279a56f99e16c67abe14", - "width": 16, - }, - { - "height": 32, - "url": "https://preview.redd.it/award_images/t5_22cerq/5nswjpyy44551_Ally.png?width=32&height=32&auto=webp&s=a8e1d0c2994e6e0b254fab1611d539a4fb94e38a", - "width": 32, - }, - { - "height": 48, - "url": "https://preview.redd.it/award_images/t5_22cerq/5nswjpyy44551_Ally.png?width=48&height=48&auto=webp&s=723e4e932c9692ac61cf5b7509424c6ae1b5d220", - "width": 48, - }, - { - "height": 64, - "url": "https://preview.redd.it/award_images/t5_22cerq/5nswjpyy44551_Ally.png?width=64&height=64&auto=webp&s=b7f0640e403ac0ef31236a4a0b7f3dc25de6046c", - "width": 64, - }, - { - "height": 128, - "url": "https://preview.redd.it/award_images/t5_22cerq/5nswjpyy44551_Ally.png?width=128&height=128&auto=webp&s=ac954bb1a06af66bf9295bbfee4550443fb6f21d", - "width": 128, - }, - ], - "start_date": None, - "static_icon_height": 2048, - "static_icon_url": "https://i.redd.it/award_images/t5_22cerq/5nswjpyy44551_Ally.png", - "static_icon_width": 2048, - "subreddit_coin_reward": 0, - "subreddit_id": None, - }, - ], + "all_awardings": [], "allow_live_comments": True, "approved_at_utc": None, "approved_by": None, @@ -2567,258 +2035,7 @@ image_mock = { }, { "data": { - "all_awardings": [ - { - "award_sub_type": "PREMIUM", - "award_type": "global", - "coin_price": 30, - "coin_reward": 0, - "count": 1, - "days_of_drip_extension": 0, - "days_of_premium": 0, - "description": "A golden " "splash of " "respect", - "end_date": None, - "giver_coin_reward": None, - "icon_format": None, - "icon_height": 2048, - "icon_url": "https://i.redd.it/award_images/t5_22cerq/80j20o397jj41_NarwhalSalute.png", - "icon_width": 2048, - "id": "award_a2506925-fc82-4d6c-ae3b-b7217e09d7f0", - "is_enabled": True, - "is_new": False, - "name": "Narwhal Salute", - "penny_donate": None, - "penny_price": None, - "resized_icons": [ - { - "height": 16, - "url": "https://preview.redd.it/award_images/t5_22cerq/80j20o397jj41_NarwhalSalute.png?width=16&height=16&auto=webp&s=4e475e8c3265ec7148d7f4204f07d33949482f21", - "width": 16, - }, - { - "height": 32, - "url": "https://preview.redd.it/award_images/t5_22cerq/80j20o397jj41_NarwhalSalute.png?width=32&height=32&auto=webp&s=42e32a4b9f1e70791716c3be283e89951e212a69", - "width": 32, - }, - { - "height": 48, - "url": "https://preview.redd.it/award_images/t5_22cerq/80j20o397jj41_NarwhalSalute.png?width=48&height=48&auto=webp&s=5adb621fede4e8e66b952a379ad038fcc1b8ad13", - "width": 48, - }, - { - "height": 64, - "url": "https://preview.redd.it/award_images/t5_22cerq/80j20o397jj41_NarwhalSalute.png?width=64&height=64&auto=webp&s=6161edea19569bbee73ef322a2e5470535ec1787", - "width": 64, - }, - { - "height": 128, - "url": "https://preview.redd.it/award_images/t5_22cerq/80j20o397jj41_NarwhalSalute.png?width=128&height=128&auto=webp&s=5d2c75f44f176f430e936204f9a53b8a2957f2fc", - "width": 128, - }, - ], - "resized_static_icons": [ - { - "height": 16, - "url": "https://preview.redd.it/award_images/t5_22cerq/80j20o397jj41_NarwhalSalute.png?width=16&height=16&auto=webp&s=4e475e8c3265ec7148d7f4204f07d33949482f21", - "width": 16, - }, - { - "height": 32, - "url": "https://preview.redd.it/award_images/t5_22cerq/80j20o397jj41_NarwhalSalute.png?width=32&height=32&auto=webp&s=42e32a4b9f1e70791716c3be283e89951e212a69", - "width": 32, - }, - { - "height": 48, - "url": "https://preview.redd.it/award_images/t5_22cerq/80j20o397jj41_NarwhalSalute.png?width=48&height=48&auto=webp&s=5adb621fede4e8e66b952a379ad038fcc1b8ad13", - "width": 48, - }, - { - "height": 64, - "url": "https://preview.redd.it/award_images/t5_22cerq/80j20o397jj41_NarwhalSalute.png?width=64&height=64&auto=webp&s=6161edea19569bbee73ef322a2e5470535ec1787", - "width": 64, - }, - { - "height": 128, - "url": "https://preview.redd.it/award_images/t5_22cerq/80j20o397jj41_NarwhalSalute.png?width=128&height=128&auto=webp&s=5d2c75f44f176f430e936204f9a53b8a2957f2fc", - "width": 128, - }, - ], - "start_date": None, - "static_icon_height": 2048, - "static_icon_url": "https://i.redd.it/award_images/t5_22cerq/80j20o397jj41_NarwhalSalute.png", - "static_icon_width": 2048, - "subreddit_coin_reward": 0, - "subreddit_id": None, - }, - { - "award_sub_type": "GLOBAL", - "award_type": "global", - "coin_price": 100, - "coin_reward": 0, - "count": 1, - "days_of_drip_extension": 0, - "days_of_premium": 0, - "description": "Shows the " - "Silver " - "Award... " - "and that's " - "it.", - "end_date": None, - "giver_coin_reward": None, - "icon_format": None, - "icon_height": 512, - "icon_url": "https://www.redditstatic.com/gold/awards/icon/silver_512.png", - "icon_width": 512, - "id": "gid_1", - "is_enabled": True, - "is_new": False, - "name": "Silver", - "penny_donate": None, - "penny_price": None, - "resized_icons": [ - { - "height": 16, - "url": "https://www.redditstatic.com/gold/awards/icon/silver_16.png", - "width": 16, - }, - { - "height": 32, - "url": "https://www.redditstatic.com/gold/awards/icon/silver_32.png", - "width": 32, - }, - { - "height": 48, - "url": "https://www.redditstatic.com/gold/awards/icon/silver_48.png", - "width": 48, - }, - { - "height": 64, - "url": "https://www.redditstatic.com/gold/awards/icon/silver_64.png", - "width": 64, - }, - { - "height": 128, - "url": "https://www.redditstatic.com/gold/awards/icon/silver_128.png", - "width": 128, - }, - ], - "resized_static_icons": [ - { - "height": 16, - "url": "https://www.redditstatic.com/gold/awards/icon/silver_16.png", - "width": 16, - }, - { - "height": 32, - "url": "https://www.redditstatic.com/gold/awards/icon/silver_32.png", - "width": 32, - }, - { - "height": 48, - "url": "https://www.redditstatic.com/gold/awards/icon/silver_48.png", - "width": 48, - }, - { - "height": 64, - "url": "https://www.redditstatic.com/gold/awards/icon/silver_64.png", - "width": 64, - }, - { - "height": 128, - "url": "https://www.redditstatic.com/gold/awards/icon/silver_128.png", - "width": 128, - }, - ], - "start_date": None, - "static_icon_height": 512, - "static_icon_url": "https://www.redditstatic.com/gold/awards/icon/silver_512.png", - "static_icon_width": 512, - "subreddit_coin_reward": 0, - "subreddit_id": None, - }, - { - "award_sub_type": "GLOBAL", - "award_type": "global", - "coin_price": 70, - "coin_reward": 0, - "count": 1, - "days_of_drip_extension": 0, - "days_of_premium": 0, - "description": "When " "goodness " "lifts you", - "end_date": None, - "giver_coin_reward": 0, - "icon_format": "PNG", - "icon_height": 2048, - "icon_url": "https://i.redd.it/award_images/t5_22cerq/gva4vt20qc751_FaithInHumanityRestored.png", - "icon_width": 2048, - "id": "award_7becef23-fb0b-4d62-b8a6-01d5759367cb", - "is_enabled": True, - "is_new": False, - "name": "Faith In Humanity " "Restored", - "penny_donate": 0, - "penny_price": 0, - "resized_icons": [ - { - "height": 16, - "url": "https://preview.redd.it/award_images/t5_22cerq/gva4vt20qc751_FaithInHumanityRestored.png?width=16&height=16&auto=webp&s=19c8ba1570a2447a04354e05a9463f3d2063f522", - "width": 16, - }, - { - "height": 32, - "url": "https://preview.redd.it/award_images/t5_22cerq/gva4vt20qc751_FaithInHumanityRestored.png?width=32&height=32&auto=webp&s=6222517b5d76c737ce1ad1ab55c42e3ce53c11d7", - "width": 32, - }, - { - "height": 48, - "url": "https://preview.redd.it/award_images/t5_22cerq/gva4vt20qc751_FaithInHumanityRestored.png?width=48&height=48&auto=webp&s=5f5d88a13a1a514298ec5c7edc6f2506750f3c4a", - "width": 48, - }, - { - "height": 64, - "url": "https://preview.redd.it/award_images/t5_22cerq/gva4vt20qc751_FaithInHumanityRestored.png?width=64&height=64&auto=webp&s=3af85a35bcd871d432337f309f6ea333181b4092", - "width": 64, - }, - { - "height": 128, - "url": "https://preview.redd.it/award_images/t5_22cerq/gva4vt20qc751_FaithInHumanityRestored.png?width=128&height=128&auto=webp&s=4631e5c3e2cda226cb2725e9eff118c7b419a95e", - "width": 128, - }, - ], - "resized_static_icons": [ - { - "height": 16, - "url": "https://preview.redd.it/award_images/t5_22cerq/gva4vt20qc751_FaithInHumanityRestored.png?width=16&height=16&auto=webp&s=19c8ba1570a2447a04354e05a9463f3d2063f522", - "width": 16, - }, - { - "height": 32, - "url": "https://preview.redd.it/award_images/t5_22cerq/gva4vt20qc751_FaithInHumanityRestored.png?width=32&height=32&auto=webp&s=6222517b5d76c737ce1ad1ab55c42e3ce53c11d7", - "width": 32, - }, - { - "height": 48, - "url": "https://preview.redd.it/award_images/t5_22cerq/gva4vt20qc751_FaithInHumanityRestored.png?width=48&height=48&auto=webp&s=5f5d88a13a1a514298ec5c7edc6f2506750f3c4a", - "width": 48, - }, - { - "height": 64, - "url": "https://preview.redd.it/award_images/t5_22cerq/gva4vt20qc751_FaithInHumanityRestored.png?width=64&height=64&auto=webp&s=3af85a35bcd871d432337f309f6ea333181b4092", - "width": 64, - }, - { - "height": 128, - "url": "https://preview.redd.it/award_images/t5_22cerq/gva4vt20qc751_FaithInHumanityRestored.png?width=128&height=128&auto=webp&s=4631e5c3e2cda226cb2725e9eff118c7b419a95e", - "width": 128, - }, - ], - "start_date": None, - "static_icon_height": 2048, - "static_icon_url": "https://i.redd.it/award_images/t5_22cerq/gva4vt20qc751_FaithInHumanityRestored.png", - "static_icon_width": 2048, - "subreddit_coin_reward": 0, - "subreddit_id": None, - }, - ], + "all_awardings": [], "allow_live_comments": True, "approved_at_utc": None, "approved_by": None, @@ -3292,7 +2509,159 @@ external_image_mock = { "wls": 6, }, "kind": "t3", - } + }, + { + "kind": "t3", + "data": { + "approved_at_utc": None, + "subreddit": "aww", + "selftext": "", + "author_fullname": "t2_78ni2", + "saved": False, + "mod_reason_title": None, + "gilded": 0, + "clicked": False, + "title": "Novosibirsk Zoo welcomes 16 cobalt-eyed Pallas’s cat kittens", + "link_flair_richtext": [], + "subreddit_name_prefixed": "r/aww", + "hidden": False, + "pwls": 6, + "link_flair_css_class": None, + "downs": 0, + "thumbnail_height": 93, + "top_awarded_type": None, + "hide_score": False, + "name": "t3_huoldn", + "quarantine": False, + "link_flair_text_color": "dark", + "upvote_ratio": 0.99, + "author_flair_background_color": None, + "subreddit_type": "public", + "ups": 1933, + "total_awards_received": 0, + "media_embed": {}, + "thumbnail_width": 140, + "author_flair_template_id": None, + "is_original_content": False, + "user_reports": [], + "secure_media": None, + "is_reddit_media_domain": False, + "is_meta": False, + "category": None, + "secure_media_embed": {}, + "link_flair_text": None, + "can_mod_post": False, + "score": 1933, + "approved_by": None, + "author_premium": False, + "thumbnail": "https://a.thumbs.redditmedia.com/j-D-Z79QQ6tGk0E3SGdb8GzqbLVUY3lu59tDaXbOYl8.jpg", + "edited": False, + "author_flair_css_class": None, + "author_flair_richtext": [], + "gildings": {}, + "post_hint": "image", + "content_categories": None, + "is_self": False, + "mod_note": None, + "created": 1595292144, + "link_flair_type": "text", + "wls": 6, + "removed_by_category": None, + "banned_by": None, + "author_flair_type": "text", + "domain": "i.imgur.com", + "allow_live_comments": False, + "selftext_html": None, + "likes": None, + "suggested_sort": None, + "banned_at_utc": None, + "url_overridden_by_dest": "https://i.imgur.com/usfMVUJ.jpg", + "view_count": None, + "archived": False, + "no_follow": False, + "is_crosspostable": False, + "pinned": False, + "over_18": False, + "preview": { + "images": [ + { + "source": { + "url": "https://external-preview.redd.it/iPfDCL-dfB4_TmnGsMEXWJMzxXmBEMPuV5ejLkYBNVo.jpg?auto=webp&s=2126d34a0134efa94ecab03917944709c8bc3305", + "width": 1024, + "height": 682, + }, + "resolutions": [ + { + "url": "https://external-preview.redd.it/iPfDCL-dfB4_TmnGsMEXWJMzxXmBEMPuV5ejLkYBNVo.jpg?width=108&crop=smart&auto=webp&s=710a44f787b98a0a37ca543b7428917ee55b3c46", + "width": 108, + "height": 71, + }, + { + "url": "https://external-preview.redd.it/iPfDCL-dfB4_TmnGsMEXWJMzxXmBEMPuV5ejLkYBNVo.jpg?width=216&crop=smart&auto=webp&s=b1bcdd7734a3a569f99fa88c6be9447105e58276", + "width": 216, + "height": 143, + }, + { + "url": "https://external-preview.redd.it/iPfDCL-dfB4_TmnGsMEXWJMzxXmBEMPuV5ejLkYBNVo.jpg?width=320&crop=smart&auto=webp&s=1671bf09a7b73d0ca51cf2de884b37d6a3591d6a", + "width": 320, + "height": 213, + }, + { + "url": "https://external-preview.redd.it/iPfDCL-dfB4_TmnGsMEXWJMzxXmBEMPuV5ejLkYBNVo.jpg?width=640&crop=smart&auto=webp&s=9fcdddbaeaad13273e0b53a862c73c4fee9f7e3d", + "width": 640, + "height": 426, + }, + { + "url": "https://external-preview.redd.it/iPfDCL-dfB4_TmnGsMEXWJMzxXmBEMPuV5ejLkYBNVo.jpg?width=960&crop=smart&auto=webp&s=e531480236c0ae72b78f27dd88f2cedc9f73cccc", + "width": 960, + "height": 639, + }, + ], + "variants": {}, + "id": "oJ9pHVA-JhoodtgNlku8ZQv8FhtadS2r36wGLAriUtY", + } + ], + "enabled": True, + }, + "all_awardings": [], + "awarders": [], + "media_only": False, + "can_gild": False, + "spoiler": False, + "locked": False, + "author_flair_text": None, + "treatment_tags": [], + "visited": False, + "removed_by": None, + "num_reports": None, + "distinguished": None, + "subreddit_id": "t5_2qh1o", + "mod_reason_by": None, + "removal_reason": None, + "link_flair_background_color": "", + "id": "huoldn", + "is_robot_indexable": True, + "report_reasons": None, + "author": "Ben_zyl", + "discussion_type": None, + "num_comments": 20, + "send_replies": True, + "whitelist_status": "all_ads", + "contest_mode": False, + "mod_reports": [], + "author_patreon_flair": False, + "author_flair_text_color": None, + "permalink": "/r/aww/comments/huoldn/novosibirsk_zoo_welcomes_16_cobalteyed_pallass/", + "parent_whitelist_status": "all_ads", + "stickied": False, + "url": "https://i.imgur.com/usfMVUJ.jpg", + "subreddit_subscribers": 25723833, + "created_utc": 1595263344, + "num_crossposts": 0, + "media": None, + "is_video": False, + }, + }, ], "dist": 25, "modhash": None, @@ -3307,102 +2676,7 @@ video_mock = { "children": [ { "data": { - "all_awardings": [ - { - "award_sub_type": "GLOBAL", - "award_type": "global", - "coin_price": 500, - "coin_reward": 100, - "count": 1, - "days_of_drip_extension": 0, - "days_of_premium": 7, - "description": "Gives the " - "author a " - "week of " - "Reddit " - "Premium, " - "%{coin_symbol}100 " - "Coins to " - "do with as " - "they " - "please, " - "and shows " - "a Gold " - "Award.", - "end_date": None, - "giver_coin_reward": None, - "icon_format": None, - "icon_height": 512, - "icon_url": "https://www.redditstatic.com/gold/awards/icon/gold_512.png", - "icon_width": 512, - "id": "gid_2", - "is_enabled": True, - "is_new": False, - "name": "Gold", - "penny_donate": None, - "penny_price": None, - "resized_icons": [ - { - "height": 16, - "url": "https://www.redditstatic.com/gold/awards/icon/gold_16.png", - "width": 16, - }, - { - "height": 32, - "url": "https://www.redditstatic.com/gold/awards/icon/gold_32.png", - "width": 32, - }, - { - "height": 48, - "url": "https://www.redditstatic.com/gold/awards/icon/gold_48.png", - "width": 48, - }, - { - "height": 64, - "url": "https://www.redditstatic.com/gold/awards/icon/gold_64.png", - "width": 64, - }, - { - "height": 128, - "url": "https://www.redditstatic.com/gold/awards/icon/gold_128.png", - "width": 128, - }, - ], - "resized_static_icons": [ - { - "height": 16, - "url": "https://www.redditstatic.com/gold/awards/icon/gold_16.png", - "width": 16, - }, - { - "height": 32, - "url": "https://www.redditstatic.com/gold/awards/icon/gold_32.png", - "width": 32, - }, - { - "height": 48, - "url": "https://www.redditstatic.com/gold/awards/icon/gold_48.png", - "width": 48, - }, - { - "height": 64, - "url": "https://www.redditstatic.com/gold/awards/icon/gold_64.png", - "width": 64, - }, - { - "height": 128, - "url": "https://www.redditstatic.com/gold/awards/icon/gold_128.png", - "width": 128, - }, - ], - "start_date": None, - "static_icon_height": 512, - "static_icon_url": "https://www.redditstatic.com/gold/awards/icon/gold_512.png", - "static_icon_width": 512, - "subreddit_coin_reward": 0, - "subreddit_id": None, - } - ], + "all_awardings": [], "allow_live_comments": False, "approved_at_utc": None, "approved_by": None, @@ -3563,94 +2837,7 @@ video_mock = { }, { "data": { - "all_awardings": [ - { - "award_sub_type": "GLOBAL", - "award_type": "global", - "coin_price": 125, - "coin_reward": 0, - "count": 1, - "days_of_drip_extension": 0, - "days_of_premium": 0, - "description": "When you " - "come " - "across a " - "feel-good " - "thing.", - "end_date": None, - "giver_coin_reward": None, - "icon_format": None, - "icon_height": 2048, - "icon_url": "https://i.redd.it/award_images/t5_22cerq/5izbv4fn0md41_Wholesome.png", - "icon_width": 2048, - "id": "award_5f123e3d-4f48-42f4-9c11-e98b566d5897", - "is_enabled": True, - "is_new": False, - "name": "Wholesome", - "penny_donate": None, - "penny_price": None, - "resized_icons": [ - { - "height": 16, - "url": "https://preview.redd.it/award_images/t5_22cerq/5izbv4fn0md41_Wholesome.png?width=16&height=16&auto=webp&s=92932f465d58e4c16b12b6eac4ca07d27e3d11c0", - "width": 16, - }, - { - "height": 32, - "url": "https://preview.redd.it/award_images/t5_22cerq/5izbv4fn0md41_Wholesome.png?width=32&height=32&auto=webp&s=d11484a208d68a318bf9d4fcf371171a1cb6a7ef", - "width": 32, - }, - { - "height": 48, - "url": "https://preview.redd.it/award_images/t5_22cerq/5izbv4fn0md41_Wholesome.png?width=48&height=48&auto=webp&s=febdf28b6f39f7da7eb1365325b85e0bb49a9f63", - "width": 48, - }, - { - "height": 64, - "url": "https://preview.redd.it/award_images/t5_22cerq/5izbv4fn0md41_Wholesome.png?width=64&height=64&auto=webp&s=b4406a2d88bf86fa3dc8a45aacf7e0c7bdccc4fb", - "width": 64, - }, - { - "height": 128, - "url": "https://preview.redd.it/award_images/t5_22cerq/5izbv4fn0md41_Wholesome.png?width=128&height=128&auto=webp&s=19555b13e3e196b62eeb9160d1ac1d1b372dcb0b", - "width": 128, - }, - ], - "resized_static_icons": [ - { - "height": 16, - "url": "https://preview.redd.it/award_images/t5_22cerq/5izbv4fn0md41_Wholesome.png?width=16&height=16&auto=webp&s=92932f465d58e4c16b12b6eac4ca07d27e3d11c0", - "width": 16, - }, - { - "height": 32, - "url": "https://preview.redd.it/award_images/t5_22cerq/5izbv4fn0md41_Wholesome.png?width=32&height=32&auto=webp&s=d11484a208d68a318bf9d4fcf371171a1cb6a7ef", - "width": 32, - }, - { - "height": 48, - "url": "https://preview.redd.it/award_images/t5_22cerq/5izbv4fn0md41_Wholesome.png?width=48&height=48&auto=webp&s=febdf28b6f39f7da7eb1365325b85e0bb49a9f63", - "width": 48, - }, - { - "height": 64, - "url": "https://preview.redd.it/award_images/t5_22cerq/5izbv4fn0md41_Wholesome.png?width=64&height=64&auto=webp&s=b4406a2d88bf86fa3dc8a45aacf7e0c7bdccc4fb", - "width": 64, - }, - { - "height": 128, - "url": "https://preview.redd.it/award_images/t5_22cerq/5izbv4fn0md41_Wholesome.png?width=128&height=128&auto=webp&s=19555b13e3e196b62eeb9160d1ac1d1b372dcb0b", - "width": 128, - }, - ], - "start_date": None, - "static_icon_height": 2048, - "static_icon_url": "https://i.redd.it/award_images/t5_22cerq/5izbv4fn0md41_Wholesome.png", - "static_icon_width": 2048, - "subreddit_coin_reward": 0, - "subreddit_id": None, - } - ], + "all_awardings": [], "allow_live_comments": True, "approved_at_utc": None, "approved_by": None, @@ -4381,3 +3568,168 @@ external_video_mock = { }, "kind": "Listing", } + +external_gifv_mock = { + "data": { + "after": "t3_hr3mhe", + "before": None, + "children": [ + { + "kind": "t3", + "data": { + "approved_at_utc": None, + "subreddit": "aww", + "selftext": "", + "author_fullname": "t2_ygx0p1u", + "saved": False, + "mod_reason_title": None, + "gilded": 0, + "clicked": False, + "title": "if i fits i sits", + "link_flair_richtext": [], + "subreddit_name_prefixed": "r/aww", + "hidden": False, + "pwls": 6, + "link_flair_css_class": None, + "downs": 0, + "thumbnail_height": 74, + "top_awarded_type": None, + "hide_score": False, + "name": "t3_humdlf", + "quarantine": False, + "link_flair_text_color": "dark", + "upvote_ratio": 0.97, + "author_flair_background_color": "", + "subreddit_type": "public", + "ups": 7512, + "total_awards_received": 1, + "media_embed": {}, + "thumbnail_width": 140, + "author_flair_template_id": None, + "is_original_content": False, + "user_reports": [], + "secure_media": None, + "is_reddit_media_domain": False, + "is_meta": False, + "category": None, + "secure_media_embed": {}, + "link_flair_text": None, + "can_mod_post": False, + "score": 7512, + "approved_by": None, + "author_premium": True, + "thumbnail": "https://b.thumbs.redditmedia.com/QHK44nUFZup-hfFX2Z1dXhk-1lPEmROUCB3bBujvTck.jpg", + "edited": False, + "author_flair_css_class": "k", + "author_flair_richtext": [], + "gildings": {}, + "post_hint": "link", + "content_categories": None, + "is_self": False, + "mod_note": None, + "created": 1595284712, + "link_flair_type": "text", + "wls": 6, + "removed_by_category": None, + "banned_by": None, + "author_flair_type": "text", + "domain": "i.imgur.com", + "allow_live_comments": False, + "selftext_html": None, + "likes": None, + "suggested_sort": "confidence", + "banned_at_utc": None, + "url_overridden_by_dest": "https://i.imgur.com/grVh2AG.gifv", + "view_count": None, + "archived": False, + "no_follow": False, + "is_crosspostable": False, + "pinned": False, + "over_18": False, + "preview": { + "images": [ + { + "source": { + "url": "https://external-preview.redd.it/XDHMFAMlcn3iuSqmWeDIc4yG-q-6xnTIdGivYX-cus4.jpg?auto=webp&s=c4ba246318b3502b080d37fcbdb12e07221401a9", + "width": 638, + "height": 338, + }, + "resolutions": [ + { + "url": "https://external-preview.redd.it/XDHMFAMlcn3iuSqmWeDIc4yG-q-6xnTIdGivYX-cus4.jpg?width=108&crop=smart&auto=webp&s=c9c340a60ba3da1af3f5d5c08f3ed618ebd567d4", + "width": 108, + "height": 57, + }, + { + "url": "https://external-preview.redd.it/XDHMFAMlcn3iuSqmWeDIc4yG-q-6xnTIdGivYX-cus4.jpg?width=216&crop=smart&auto=webp&s=d05c0415e3dc63d097264bfb1b35b09676bd24f6", + "width": 216, + "height": 114, + }, + { + "url": "https://external-preview.redd.it/XDHMFAMlcn3iuSqmWeDIc4yG-q-6xnTIdGivYX-cus4.jpg?width=320&crop=smart&auto=webp&s=5c236179ccfff29e9ba980f31d5a6a9905adbe86", + "width": 320, + "height": 169, + }, + ], + "variants": {}, + "id": "4Z8zF5e4sZJnX4vWH7pZkbqiDPMCuh2J4kNotV9AGSI", + } + ], + "reddit_video_preview": { + "fallback_url": "https://v.redd.it/zzctc8y2dzb51/DASH_240.mp4", + "height": 338, + "width": 638, + "scrubber_media_url": "https://v.redd.it/zzctc8y2dzb51/DASH_96.mp4", + "dash_url": "https://v.redd.it/zzctc8y2dzb51/DASHPlaylist.mpd", + "duration": 44, + "hls_url": "https://v.redd.it/zzctc8y2dzb51/HLSPlaylist.m3u8", + "is_gif": True, + "transcoding_status": "completed", + }, + "enabled": False, + }, + "all_awardings": [], + "awarders": [], + "media_only": False, + "can_gild": False, + "spoiler": False, + "locked": False, + "author_flair_text": None, + "treatment_tags": [], + "visited": False, + "removed_by": None, + "num_reports": None, + "distinguished": None, + "subreddit_id": "t5_2qh1o", + "mod_reason_by": None, + "removal_reason": None, + "link_flair_background_color": "", + "id": "humdlf", + "is_robot_indexable": True, + "report_reasons": None, + "author": "jasontaken", + "discussion_type": None, + "num_comments": 67, + "send_replies": False, + "whitelist_status": "all_ads", + "contest_mode": False, + "mod_reports": [], + "author_patreon_flair": False, + "author_flair_text_color": "dark", + "permalink": "/r/aww/comments/humdlf/if_i_fits_i_sits/", + "parent_whitelist_status": "all_ads", + "stickied": False, + "url": "https://i.imgur.com/grVh2AG.gifv", + "subreddit_subscribers": 25723833, + "created_utc": 1595255912, + "num_crossposts": 1, + "media": None, + "is_video": False, + }, + } + ], + "dist": 25, + "modhash": None, + }, + "kind": "Listing", +} diff --git a/src/newsreader/news/collection/tests/reddit/builder/tests.py b/src/newsreader/news/collection/tests/reddit/builder/tests.py index b9ecb8e..58edcd8 100644 --- a/src/newsreader/news/collection/tests/reddit/builder/tests.py +++ b/src/newsreader/news/collection/tests/reddit/builder/tests.py @@ -251,13 +251,53 @@ class RedditBuilderTestCase(TestCase): ) url = "https://i.redd.it/cm2qybia1va51.jpg" + self.assertEquals( + "https://www.reddit.com/r/aww/comments/hr64xh/yall_i_just_cant_this_is_my_son_judah_my_wife_and/", + post.url, + ) self.assertEquals( f'
{title}
', post.body ) - @skip("Not implemented") def test_external_image_post(self): - pass + builder = RedditBuilder + + subreddit = SubredditFactory() + mock_stream = MagicMock(rule=subreddit) + + with builder((external_image_mock, mock_stream)) as builder: + builder.save() + + posts = {post.remote_identifier: post for post in Post.objects.all()} + + self.assertCountEqual(("hr41am", "huoldn"), posts.keys()) + + post = posts["hr41am"] + + url = "http://gfycat.com/thatalivedogwoodclubgall" + title = "Excited cows have a new brush!" + + self.assertEquals( + f'
Direct url
', + post.body, + ) + self.assertEquals( + "https://www.reddit.com/r/aww/comments/hr41am/excited_cows_have_a_new_brush/", + post.url, + ) + + post = posts["huoldn"] + + url = "https://i.imgur.com/usfMVUJ.jpg" + title = "Novosibirsk Zoo welcomes 16 cobalt-eyed Pallas’s cat kittens" + + self.assertEquals( + f'
{title}
', post.body + ) + self.assertEquals( + "https://www.reddit.com/r/aww/comments/huoldn/novosibirsk_zoo_welcomes_16_cobalteyed_pallass/", + post.url, + ) @skip("Not implemented") def test_video_post(self): @@ -267,6 +307,10 @@ class RedditBuilderTestCase(TestCase): def test_external_video_post(self): pass + @skip("Not implemented") + def test_external_gifv_video_post(self): + pass + @skip("Not implemented") def test_link_only_post(self): pass