Example #1
0
    def update(self):
        """
        Push customer properties to Woocommerce REST API.

        **Note**: Woocommerce might update properties when pushing data, but these won't be updated
        on the object itself. If you want to have your properties updated you can call the
        :func:`~pywoo.models.customers.Customer.refresh()` method or use the returned object which is updated.

        :return: Customer with updated properties coming from the REST API
        :rtype: pywoo.models.customers.Customer
        """
        return self._api.update_customer(**to_dict(self))
Example #2
0
    def update(self):
        """
        Push payment gateway properties to Woocommerce REST API.

        **Note**: Woocommerce might update properties when pushing data, but these won't be updated
        on the object itself. If you want to have your properties updated you can call the
        :func:`~pywoo.models.payment_gateways.PaymentGateway.refresh()` method or use the returned object
        which is updated.

        :return: Payment gateway with updated properties coming from the REST API
        :rtype: pywoo.models.payment_gateways.PaymentGateway
        """
        return self._api.update_payment_gateway(**to_dict(self))
    def update(self):
        """
        Push product shipping properties to Woocommerce REST API.

        **Note**: Woocommerce might update properties when pushing data, but these won't be updated
        on the object itself. If you want to have your properties updated you can call the
        :func:`~pywoo.models.product_shipping_classes.ProductShipping.refresh()` method or use the returned object
        which is updated.

        :return: Product shipping with updated properties coming from the REST API
        :rtype: pywoo.models.product_shipping_classes.ProductShipping
        """
        return self._api.update_product_shipping_class(**to_dict(self))
Example #4
0
    def update(self):
        """
        Push refund properties to Woocommerce REST API.

        **Note**: Woocommerce might update properties when pushing data, but these won't be updated
        on the object itself. If you want to have your properties updated you can call the
        :func:`~pywoo.models.refunds.Refund.refresh()` method or use the returned object
        which is updated.

        :return: Product with updated properties coming from the REST API
        :rtype: pywoo.models.refunds.Refund
        """
        return self._api.update_refund(self.order_id, self.id, **to_dict(self))
Example #5
0
    def update(self):
        """
        Push product attribute term properties to Woocommerce REST API.

        **Note**: Woocommerce might update properties when pushing data, but these won't be updated
        on the object itself. If you want to have your properties updated you can call the
        :func:`~pywoo.models.products_attribute_terms.ProductAttributeTerm.refresh()` method or use the returned object
        which is updated.

        :return: Product attribute term with updated properties coming from the REST API
        :rtype: pywoo.models.products_attribute_terms.ProductAttributeTerm
        """
        return self._api.update_product_attribute_term(
            self.product_attribute_id, **to_dict(self))
    def update(self):
        """
        Push shipping zone method properties to Woocommerce REST API.

        **Note**: Woocommerce might update properties when pushing data, but these won't be updated
        on the object itself. If you want to have your properties updated you can call the
        :func:`~pywoo.models.shipping_zone_methods.ShippingZoneMethod.refresh()` method or use the returned object
        which is updated.

        :return: Shipping zone method with updated properties coming from the REST API
        :rtype: pywoo.models.shipping_zone_methods.ShippingZoneMethod
        """
        return self._api.update_shipping_zone_method(self.shipping_zone_id,
                                                     **to_dict(self))
Example #7
0
def mock_request(method, url, *args, **kwargs):
    to_dict(kwargs.get('json', {}))
    file = open(os.path.join(*(['.', 'tests'] + ['resources'] + url.split("/") + [method.lower() + ".json"])), 'r')
    response = MockResponse(file.read())
    file.close()
    return response