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')
 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)