コード例 #1
0
    def test_get_collection_listing_product_ids(self):
        self.fake('collection_listings/1/product_ids', method='GET', status=200, body=self.load_fixture('collection_listing_product_ids'))

        collection_listing = shopify.CollectionListing()
        collection_listing.id = 1
        product_ids = collection_listing.product_ids()

        self.assertEqual([1, 2], product_ids)
コード例 #2
0
    def test_reload_collection_listing(self):
        self.fake('collection_listings/1', method='GET', status=200, body=self.load_fixture('collection_listing'))

        collection_listing = shopify.CollectionListing()
        collection_listing.collection_id = 1
        collection_listing.reload()

        self.assertEqual(1, collection_listing.collection_id)
        self.assertEqual("Home page", collection_listing.title)
コード例 #3
0
    def test_reload_collection_listing(self):
        self.fake("collection_listings/1", method="GET", code=200, body=self.load_fixture("collection_listing"))

        collection_listing = shopify.CollectionListing()
        collection_listing.collection_id = 1
        collection_listing.reload()

        self.assertEqual(1, collection_listing.collection_id)
        self.assertEqual("Home page", collection_listing.title)
コード例 #4
0
    def test_get_collection_listing_product_ids(self):
        self.fake(
            "collection_listings/1/product_ids",
            method="GET",
            code=200,
            body=self.load_fixture("collection_listing_product_ids"),
        )

        collection_listing = shopify.CollectionListing()
        collection_listing.id = 1
        product_ids = collection_listing.product_ids()

        self.assertEqual([1, 2], product_ids)