コード例 #1
0
 def test_create(self):
     shipment = test_shipment.create_mock_shipment()
     rates = shippo.Shipment.get_rates(shipment.object_id, sync=True)
     rate = rates.results[0]
     TRANSACTION = DUMMY_TRANSACTION.copy()
     TRANSACTION['rate'] = rate.object_id
     transaction = shippo.Transaction.create(**TRANSACTION)
     self.assertEqual(transaction.object_state, 'VALID')
コード例 #2
0
 def test_retrieve(self):
     shipment = test_shipment.create_mock_shipment()
     rates = shippo.Shipment.get_rates(shipment.object_id, sync=True)
     rate = rates.results[0]
     TRANSACTION = DUMMY_TRANSACTION.copy()
     TRANSACTION['rate'] = rate.object_id
     transaction = shippo.Transaction.create(**TRANSACTION)
     retrieve = shippo.Transaction.retrieve(transaction.object_id)
     self.assertItemsEqual(transaction, retrieve)
コード例 #3
0
 def test_retrieve(self):
     shipment = test_shipment.create_mock_shipment()
     rates = shippo.Shipment.get_rates(shipment.object_id, sync=True)
     rate = rates.results[0]
     retrieve = shippo.Rate.retrieve(rate.object_id)
     self.assertItemsEqual(rate, retrieve)