コード例 #1
0
    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)
コード例 #2
0
ファイル: test_till.py プロジェクト: rg3915/stoq
    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)
コード例 #3
0
ファイル: test_till.py プロジェクト: romaia/stoq
    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)
コード例 #4
0
    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)
コード例 #5
0
ファイル: test_till.py プロジェクト: rg3915/stoq
    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)
コード例 #6
0
    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)