Example #1
0
 def test_create_with_fees(self):
     fee_node = SynapseUsNode.create(self.user,
                                     'Python Test SYNAPSE-US Node')
     fee_node2 = SynapseUsNode.create(self.user,
                                      'Python Test SYNAPSE-US Node2')
     test_fees = [{
         'fee': 0.12,
         'note': 'Test Fee 1',
         'to': {
             'id': fee_node.id
         }
     }]
     transaction_id = Transaction.create(self.from_node,
                                         self.to_node.type,
                                         self.to_node.id,
                                         1.00,
                                         'USD',
                                         '127.0.0.1',
                                         supp_id='ABC123',
                                         fees=test_fees).id
     transaction = Transaction.by_id(self.from_node, transaction_id)
     self.assertIsInstance(transaction, Transaction)
     self.assertEqual(self.from_node.id, transaction.node.id)
     self.assertEqual(transaction.fees[0]['fee'], 0.12)
     self.assertEqual(len(transaction.fees), 1)
Example #2
0
 def test_by_id(self):
     transaction_id = Transaction.create(self.from_node,
                                         self.to_node.type,
                                         self.to_node.id,
                                         1.00,
                                         'USD',
                                         '127.0.0.1',
                                         supp_id='ABC123').id
     transaction = Transaction.by_id(self.from_node, transaction_id)
     self.assertEqual(self.from_node.id, transaction.node.id)
     self.assertIsInstance(transaction, Transaction)
     self.assertEqual(transaction_id, transaction.id)
 def test_by_id(self):
     transaction_id = Transaction.create(self.from_node,
                                         self.to_node.type,
                                         self.to_node.id,
                                         1.00,
                                         'USD',
                                         '127.0.0.1',
                                         supp_id='ABC123').id
     transaction = Transaction.by_id(self.from_node, transaction_id)
     self.assertEqual(self.from_node.id, transaction.node.id)
     self.assertIsInstance(transaction, Transaction)
     self.assertEqual(transaction_id, transaction.id)