Beispiel #1
0
    def test_create(self):
        item = Item()

        item.Name = self.name
        item.Type = "Inventory"
        item.TrackQtyOnHand = True
        item.QtyOnHand = 10
        item.InvStartDate = "2015-01-01"

        item.IncomeAccountRef = self.income_account.to_ref()
        item.ExpenseAccountRef = self.expense_account.to_ref()
        item.AssetAccountRef = self.asset_account.to_ref()
        item.save(qb=self.qb_client)

        query_item = Item.get(item.Id, qb=self.qb_client)

        self.assertEquals(query_item.Id, item.Id)
        self.assertEquals(query_item.Name, self.name)
        self.assertEquals(query_item.Type, "Inventory")
        self.assertEquals(query_item.TrackQtyOnHand, True)
        self.assertEquals(query_item.QtyOnHand, 10)
        self.assertEquals(query_item.IncomeAccountRef.value,
                          self.income_account.Id)
        self.assertEquals(query_item.ExpenseAccountRef.value,
                          self.expense_account.Id)
        self.assertEquals(query_item.AssetAccountRef.value,
                          self.asset_account.Id)
    def test_create(self):
        item = Item()

        item.Name = self.name
        item.Type = "Inventory"
        item.TrackQtyOnHand = True
        item.QtyOnHand = 10
        item.InvStartDate = "2015-01-01"

        item.IncomeAccountRef = self.income_account.to_ref()
        item.ExpenseAccountRef = self.expense_account.to_ref()
        item.AssetAccountRef = self.asset_account.to_ref()
        item.save(qb=self.qb_client)

        query_item = Item.get(item.Id, qb=self.qb_client)

        self.assertEquals(query_item.Id, item.Id)
        self.assertEquals(query_item.Name, self.name)
        self.assertEquals(query_item.Type, "Inventory")
        self.assertEquals(query_item.TrackQtyOnHand, True)
        self.assertEquals(query_item.QtyOnHand, 10)
        self.assertEquals(query_item.IncomeAccountRef.value, self.income_account.Id)
        self.assertEquals(query_item.ExpenseAccountRef.value, self.expense_account.Id)
        self.assertEquals(query_item.AssetAccountRef.value, self.asset_account.Id)