def test_till_open_previously_not_closed(self): yesterday = localnow() - datetime.timedelta(1) # Open a till, set the opening_date to yesterday till = Till(station=get_current_station(self.store), store=self.store) till.open_till() till.opening_date = yesterday till.close_till() till.closing_date = None self.assertRaises(TillError, till.open_till)
def testTillOpenPreviouslyNotClosed(self): yesterday = datetime.datetime.today() - datetime.timedelta(1) # Open a till, set the opening_date to yesterday till = Till(station=get_current_station(self.store), store=self.store) till.open_till() till.opening_date = yesterday till.close_till() till.closing_date = None self.assertRaises(TillError, till.open_till)
def test_till_open_previously_not_closed(self): yesterday = localnow() - datetime.timedelta(1) # Open a till, set the opening_date to yesterday till = Till(branch=self.current_branch, station=self.current_station, store=self.store) till.open_till(self.current_user) till.opening_date = yesterday till.close_till(self.current_user) till.closing_date = None with self.assertRaises(TillError): till.open_till(self.current_user)
def test_till_open_previously_opened(self): yesterday = localnow() - datetime.timedelta(1) # Open a till, set the opening_date to yesterday till = Till(station=get_current_station(self.store), store=self.store) till.open_till() till.opening_date = yesterday till.add_credit_entry(currency(10), u"") till.close_till() till.closing_date = yesterday new_till = Till(station=get_current_station(self.store), store=self.store) self.failUnless(new_till._get_last_closed_till()) new_till.open_till() self.assertEquals(new_till.initial_cash_amount, till.final_cash_amount)
def test_till_open_previously_opened(self): yesterday = localnow() - datetime.timedelta(1) # Open a till, set the opening_date to yesterday till = Till(station=get_current_station(self.store), store=self.store) till.open_till() till.opening_date = yesterday till.add_credit_entry(currency(10), u"") till.close_till() till.closing_date = yesterday new_till = Till(station=get_current_station(self.store), store=self.store) self.assertTrue(new_till._get_last_closed_till()) new_till.open_till() self.assertEqual(new_till.initial_cash_amount, till.final_cash_amount)