Esempio n. 1
0
    def test_to_LinkedTxn(self):
        invoice = Invoice()
        invoice.TotalAmt = 10
        invoice.Id = 1

        linked_txn = invoice.to_linked_txn()

        self.assertEquals(linked_txn.TxnId, invoice.Id)
        self.assertEquals(linked_txn.TxnType, "Invoice")
        self.assertEquals(linked_txn.TxnLineId, 1)
    def test_to_ref(self):
        invoice = Invoice()
        invoice.DocNumber = 1
        invoice.Id = 2

        ref = invoice.to_ref()
        self.assertIsInstance(ref, Ref)
        self.assertEquals(ref.type, "Invoice")
        self.assertEquals(ref.name, 1)  # should be DocNumber
        self.assertEquals(ref.value, 2)  # should be Id