Beispiel #1
0
    def test_object_delete(self, func):
        api = Api('', 'fake_consumer_key', 'fake_consumer_secret')

        obj = api.get_tax_classes()[-1]

        obj = obj.delete()
        assert type(obj) == TaxClass and obj.slug == 'tariffa'
Beispiel #2
0
    def test_api_get(self, func):
        api = Api('', 'fake_consumer_key', 'fake_consumer_secret')

        obj = api.get_shipping_zones()
        assert all(type(x) == ShippingZone for x in obj)

        obj = api.get_shipping_zones(id='1')
        assert type(obj) == ShippingZone and obj.id == 1
Beispiel #3
0
    def test_object_refresh(self, func):
        api = Api('', 'fake_consumer_key', 'fake_consumer_secret')

        obj = api.get_product_reviews(42)
        assert type(obj) == ProductReview and obj.id == 42

        obj.refresh()
        assert type(obj) == ProductReview and obj.id == 42
    def test_object_refresh(self, func):
        api = Api('', 'fake_consumer_key', 'fake_consumer_secret')

        obj = api.get_product_shipping_classes(24)
        assert type(obj) == ProductShipping and obj.id == 24

        obj.refresh()
        assert type(obj) == ProductShipping and obj.id == 24
    def test_object_refresh(self, func):
        api = Api('', 'fake_consumer_key', 'fake_consumer_secret')

        obj = api.get_shipping_methods(id='flat_rate')
        assert type(obj) == ShippingMethod and obj.id == 'flat_rate'

        obj.refresh()
        assert type(obj) == ShippingMethod and obj.id == 'flat_rate'
    def test_api_get(self, func):
        api = Api('', 'fake_consumer_key', 'fake_consumer_secret')

        obj = api.get_shipping_methods()
        assert all(type(x) == ShippingMethod for x in obj)

        obj = api.get_shipping_methods(id='flat_rate')
        assert type(obj) == ShippingMethod and obj.id == 'flat_rate'
    def test_api_get(self, func):
        api = Api('', 'fake_consumer_key', 'fake_consumer_secret')

        obj = api.get_shipping_zone_methods(1)
        assert all(type(x) == ShippingZoneMethod for x in obj)

        obj = api.get_shipping_zone_methods(1, 1)
        assert type(obj) == ShippingZoneMethod and obj.id == 1
    def test_api_get(self, func):
        api = Api('', 'fake_consumer_key', 'fake_consumer_secret')

        obj = api.get_product_shipping_classes()
        assert all(type(x) == ProductShipping for x in obj)

        obj = api.get_product_shipping_classes(24)
        assert type(obj) == ProductShipping and obj.id == 24
    def test_object_refresh(self, func):
        api = Api('', 'fake_consumer_key', 'fake_consumer_secret')

        obj = api.get_shipping_zone_methods(1, 1)
        assert type(obj) == ShippingZoneMethod and obj.id == 1

        obj.refresh()
        assert type(obj) == ShippingZoneMethod and obj.id == 1
    def test_api_get(self, func):
        api = Api('', 'fake_consumer_key', 'fake_consumer_secret')

        obj = api.get_product_variations(56)
        assert all(type(x) == ProductVariation for x in obj)

        obj = api.get_product_variations(56, 57)
        assert type(obj) == ProductVariation and obj.id == 57
Beispiel #11
0
    def test_api_get(self, func):
        api = Api('', 'fake_consumer_key', 'fake_consumer_secret')

        obj = api.get_product_tags()
        assert all(type(x) == ProductTag for x in obj)

        obj = api.get_product_tags(23)
        assert type(obj) == ProductTag and obj.id == 23
Beispiel #12
0
    def test_object_refresh(self, func):
        api = Api('', 'fake_consumer_key', 'fake_consumer_secret')

        obj = api.get_products(56)
        assert type(obj) == Product and obj.id == 56

        obj.refresh()
        assert type(obj) == Product and obj.id == 56
Beispiel #13
0
    def test_object_refresh(self, func):
        api = Api('', 'fake_consumer_key', 'fake_consumer_secret')

        obj = api.get_tax_rates(id='2')
        assert type(obj) == TaxRate and obj.id == 2

        obj.refresh()
        assert type(obj) == TaxRate and obj.id == 2
Beispiel #14
0
    def test_object_delete(self, func):
        api = Api('', 'fake_consumer_key', 'fake_consumer_secret')

        obj = api.get_shipping_zones(id='1')
        assert type(obj) == ShippingZone and obj.id == 1

        obj = obj.delete()
        assert type(obj) == ShippingZone and obj.id == 1
    def test_object_refresh(self, func):
        api = Api('', 'fake_consumer_key', 'fake_consumer_secret')

        obj = api.get_product_variations(56, 57)
        assert type(obj) == ProductVariation and obj.id == 57

        obj.refresh()
        assert type(obj) == ProductVariation and obj.id == 57
Beispiel #16
0
    def test_api_get(self, func):
        api = Api('', 'fake_consumer_key', 'fake_consumer_secret')

        obj = api.get_product_reviews()
        assert all(type(x) == ProductReview for x in obj)

        obj = api.get_product_reviews(42)
        assert type(obj) == ProductReview and obj.id == 42
Beispiel #17
0
    def test_object_refresh(self, func):
        api = Api('', 'fake_consumer_key', 'fake_consumer_secret')

        obj = api.get_product_tags(23)
        assert type(obj) == ProductTag and obj.id == 23

        obj.refresh()
        assert type(obj) == ProductTag and obj.id == 23
Beispiel #18
0
    def test_api_get(self, func):
        api = Api('', 'fake_consumer_key', 'fake_consumer_secret')

        obj = api.get_tax_rates()
        assert all(type(x) == TaxRate for x in obj)

        obj = api.get_tax_rates(id='2')
        assert type(obj) == TaxRate and obj.id == 2
Beispiel #19
0
    def test_object_update(self, func):
        api = Api('', 'fake_consumer_key', 'fake_consumer_secret')

        obj = ProductTag.get_product_tags(api, 23)
        assert type(obj) == ProductTag and obj.id == 23

        obj = obj.update()
        assert type(obj) == ProductTag and obj.id == 23
Beispiel #20
0
    def test_classmethod_get(self, func):
        api = Api('', 'fake_consumer_key', 'fake_consumer_secret')

        obj = ProductTag.get_product_tags(api)
        assert all(type(x) == ProductTag for x in obj)

        obj = ProductTag.get_product_tags(api, 23)
        assert type(obj) == ProductTag and obj.id == 23
Beispiel #21
0
    def test_object_update(self, func):
        api = Api('', 'fake_consumer_key', 'fake_consumer_secret')

        obj = TaxRate.get_tax_rates(api, id='2')
        assert type(obj) == TaxRate and obj.id == 2

        obj = obj.update()
        assert type(obj) == TaxRate and obj.id == 2
Beispiel #22
0
    def test_classmethod_get(self, func):
        api = Api('', 'fake_consumer_key', 'fake_consumer_secret')

        obj = TaxRate.get_tax_rates(api)
        assert all(type(x) == TaxRate for x in obj)

        obj = TaxRate.get_tax_rates(api, id='2')
        assert type(obj) == TaxRate and obj.id == 2
Beispiel #23
0
    def test_classmethod_get(self, func):
        api = Api('', 'fake_consumer_key', 'fake_consumer_secret')

        obj = Product.get_products(api)
        assert all(type(x) == Product for x in obj)

        obj = Product.get_products(api, 56)
        assert type(obj) == Product and obj.id == 56
    def test_object_update(self, func):
        api = Api('', 'fake_consumer_key', 'fake_consumer_secret')

        obj = ProductShipping.get_product_shipping_classes(api, 24)
        assert type(obj) == ProductShipping and obj.id == 24

        obj = obj.update()
        assert type(obj) == ProductShipping and obj.id == 24
Beispiel #25
0
    def test_object_update(self, func):
        api = Api('', 'fake_consumer_key', 'fake_consumer_secret')

        obj = ProductReview.get_product_reviews(api, 42)
        assert type(obj) == ProductReview and obj.id == 42

        obj = obj.update()
        assert type(obj) == ProductReview and obj.id == 42
Beispiel #26
0
    def test_classmethod_get(self, func):
        api = Api('', 'fake_consumer_key', 'fake_consumer_secret')

        obj = ProductReview.get_product_reviews(api)
        assert all(type(x) == ProductReview for x in obj)

        obj = ProductReview.get_product_reviews(api, 42)
        assert type(obj) == ProductReview and obj.id == 42
Beispiel #27
0
    def test_classmethod_get(self, func):
        api = Api('', 'fake_consumer_key', 'fake_consumer_secret')

        obj = ShippingZone.get_shipping_zone(api)
        assert all(type(x) == ShippingZone for x in obj)

        obj = ShippingZone.get_shipping_zone(api, id='1')
        assert type(obj) == ShippingZone and obj.id == 1
Beispiel #28
0
    def test_object_update(self, func):
        api = Api('', 'fake_consumer_key', 'fake_consumer_secret')

        obj = Product.get_products(api, 56)
        assert type(obj) == Product and obj.id == 56

        obj = obj.update()
        assert type(obj) == Product and obj.id == 56
    def test_object_update(self, func):
        api = Api('', 'fake_consumer_key', 'fake_consumer_secret')

        obj = ShippingZoneMethod.get_shipping_zone_methods(api, 1, 1)
        assert type(obj) == ShippingZoneMethod and obj.id == 1

        obj = obj.update()
        assert type(obj) == ShippingZoneMethod and obj.id == 1
Beispiel #30
0
    def test_object_update(self, func):
        api = Api('', 'fake_consumer_key', 'fake_consumer_secret')

        obj = ShippingZone.get_shipping_zone(api, id='1')
        assert type(obj) == ShippingZone and obj.id == 1

        obj = obj.update()
        assert type(obj) == ShippingZone and obj.id == 1