本文整理汇总了Python中stoqlib.domain.till.Till.get_balance方法的典型用法代码示例。如果您正苦于以下问题:Python Till.get_balance方法的具体用法?Python Till.get_balance怎么用?Python Till.get_balance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类stoqlib.domain.till.Till
的用法示例。
在下文中一共展示了Till.get_balance方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_add_debit_entry
# 需要导入模块: from stoqlib.domain.till import Till [as 别名]
# 或者: from stoqlib.domain.till.Till import get_balance [as 别名]
def test_add_debit_entry(self):
till = Till(store=self.store, station=self.create_station())
till.open_till()
self.assertEqual(till.get_balance(), 0)
till.add_debit_entry(10)
self.assertEqual(till.get_balance(), -10)
示例2: test_add_entry_out_payment
# 需要导入模块: from stoqlib.domain.till import Till [as 别名]
# 或者: from stoqlib.domain.till.Till import get_balance [as 别名]
def test_add_entry_out_payment(self):
till = Till(store=self.store, station=self.create_station())
till.open_till()
payment = self._create_outpayment()
self.assertEqual(till.get_balance(), 0)
till.add_entry(payment)
self.assertEqual(till.get_balance(), -10)
示例3: testAddEntryInPayment
# 需要导入模块: from stoqlib.domain.till import Till [as 别名]
# 或者: from stoqlib.domain.till.Till import get_balance [as 别名]
def testAddEntryInPayment(self):
till = Till(store=self.store,
station=self.create_station())
till.open_till()
payment = self._create_inpayment()
self.assertEqual(till.get_balance(), 0)
till.add_entry(payment)
self.assertEqual(till.get_balance(), 10)
示例4: test_get_balance
# 需要导入模块: from stoqlib.domain.till import Till [as 别名]
# 或者: from stoqlib.domain.till.Till import get_balance [as 别名]
def test_get_balance(self):
till = Till(store=self.store, station=self.create_station())
till.open_till()
old = till.get_balance()
till.add_credit_entry(currency(10), u"")
self.assertEqual(till.get_balance(), old + 10)
till.add_debit_entry(currency(5), u"")
self.assertEqual(till.get_balance(), old + 5)