Beispiel #1
0
 def test_creation_datetime(self):
     ca_order1 = channeladvisor.ChannelAdvisorOrder(
         {'CreatedDateUtc': '2021-09-10T00:54:56Z'})
     ca_order2 = channeladvisor.ChannelAdvisorOrder(
         {'CreatedDateUtc': '2021-09-27T21:49:54.32Z'})
     assert ca_order1.creation_datetime() == datetime.datetime(
         2021, 9, 10, 0, 54, 56)
     assert ca_order2.creation_datetime() == datetime.datetime(
         2021, 9, 27, 21, 49, 54)
Beispiel #2
0
 def test_lines(self):
     ca_order = channeladvisor.ChannelAdvisorOrder({
         'Items': [{
             'Sku': 'B0',
             'Title': 'clothes',
             'Quantity': 1,
             'UnitPrice': 1.23,
             'UnitEstimatedShippingCost': 0.45
         }, {
             'Sku': 'B1',
             'Title': 'shirt',
             'Quantity': 2,
             'UnitPrice': 4.56,
             'UnitEstimatedShippingCost': 0.78
         }]
     })
     assert ca_order.lines() == [{
         'sku': 'B0',
         'title': 'clothes',
         'qty': 1,
         'unit_price': 1.23,
         'unit_estimated_shipping_cost': 0.45
     }, {
         'sku': 'B1',
         'title': 'shirt',
         'qty': 2,
         'unit_price': 4.56,
         'unit_estimated_shipping_cost': 0.78
     }]
Beispiel #3
0
 def test_shipping_status(self):
     ca_order = channeladvisor.ChannelAdvisorOrder(
         {'ShippingStatus': 'Shipped'})
     assert ca_order.shipping_status() == 'Shipped'
Beispiel #4
0
 def test_site_order_id(self):
     ca_order = channeladvisor.ChannelAdvisorOrder({'SiteOrderID': '123'})
     assert ca_order.site_order_id() == '123'
Beispiel #5
0
 def test_site_name(self):
     ca_order = channeladvisor.ChannelAdvisorOrder({'SiteName': 'amazon'})
     assert ca_order.site_name() == 'amazon'
Beispiel #6
0
 def test_po_number(self):
     ca_order = channeladvisor.ChannelAdvisorOrder({'ID': 123})
     assert ca_order.po_number() == '123'
Beispiel #7
0
 def test_data(self):
     ca_order = channeladvisor.ChannelAdvisorOrder({'ID': 123})
     assert ca_order.data() == {'ID': 123}
Beispiel #8
0
 def test_repr(self):
     ca_order = channeladvisor.ChannelAdvisorOrder({'ID': 123})
     assert str(ca_order) == "ChannelAdvisorOrder({'ID': 123})"