コード例 #1
0
 def test_get_total(self):
     sale_item = self.create_sale_item()
     returned_item = ReturnedSaleItem(store=self.store,
                                      sale_item=sale_item)
     returned_item.quantity = 2
     returned_item.price = 100
     self.assertEquals(returned_item.get_total(), 200)
コード例 #2
0
    def test_sale_total(self):
        branch = self.create_branch()

        rsale = ReturnedSale(branch=branch,
                             store=self.store)
        self.assertEquals(rsale.sale_total, currency(0))

        sale = self.create_sale(branch=branch)
        sellable = self.add_product(sale)
        self.add_payments(sale)
        rsale1 = ReturnedSale(branch=branch,
                              sale=sale,
                              store=self.store)
        rsale2 = ReturnedSale(branch=branch,
                              sale=sale,
                              store=self.store)
        self.assertEquals(rsale1.sale_total, currency(0))

        item = ReturnedSaleItem(store=self.store,
                                returned_sale=rsale2,
                                sellable=sellable)
        item.quantity = 10
        item.price = 10

        self.assertEquals(rsale1.sale_total, currency(-100))
コード例 #3
0
ファイル: test_returnedsale.py プロジェクト: fuinha/stoq
 def test_get_total(self):
     sale_item = self.create_sale_item()
     returned_item = ReturnedSaleItem(store=self.store,
                                      sale_item=sale_item)
     returned_item.quantity = 2
     returned_item.price = 100
     self.assertEquals(returned_item.get_total(), 200)
コード例 #4
0
ファイル: test_returnedsale.py プロジェクト: fuinha/stoq
    def test_sale_total(self):
        branch = self.create_branch()

        rsale = ReturnedSale(branch=branch,
                             store=self.store)
        self.assertEquals(rsale.sale_total, currency(0))

        sale = self.create_sale(branch=branch)
        sellable = self.add_product(sale)
        self.add_payments(sale)
        rsale1 = ReturnedSale(branch=branch,
                              sale=sale,
                              store=self.store)
        rsale2 = ReturnedSale(branch=branch,
                              sale=sale,
                              store=self.store)
        self.assertEquals(rsale1.sale_total, currency(0))

        item = ReturnedSaleItem(store=self.store,
                                returned_sale=rsale2,
                                sellable=sellable)
        item.quantity = 10
        item.price = 10

        self.assertEquals(rsale1.sale_total, currency(-100))
コード例 #5
0
 def test_total(self):
     sale_item = self.create_sale_item()
     item = ReturnedSaleItem(store=self.store, sale_item=sale_item)
     item.quantity = 1
     self.assertEquals(item.total, 100)
     item.price = 10
     self.assertEquals(item.total, 10)
     item.quantity = 20
     self.assertEquals(item.total, 200)
コード例 #6
0
 def test_total(self):
     sale_item = self.create_sale_item()
     item = ReturnedSaleItem(store=self.store, sale_item=sale_item)
     item.quantity = 1
     self.assertEqual(item.total, 100)
     item.price = 10
     self.assertEqual(item.total, 10)
     item.quantity = 20
     self.assertEqual(item.total, 200)