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)
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)
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)
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)
def test_add_credit_entry(self): till = Till(store=self.store, branch=self.current_branch, station=self.create_station()) till.open_till(self.current_user) self.assertEqual(till.get_balance(), 0) till.add_credit_entry(10) self.assertEqual(till.get_balance(), 10)
def test_add_entry_in_payment(self): till = Till(store=self.store, branch=self.current_branch, station=self.create_station()) till.open_till(self.current_user) payment = self._create_inpayment() self.assertEqual(till.get_balance(), 0) till.add_entry(payment) self.assertEqual(till.get_balance(), 10)