예제 #1
0
    def test_campusLinkLastYears(self):

        self.ui.tabWid.setCurrentIndex(2)
        gear = tests.mkGear('J', 10)
        tests.enterGearInfo(self, gear)
        QTest.mouseClick(self.tGear.updtBut, QtCore.Qt.LeftButton)

        self.ui.tabWid.setCurrentIndex(1)
        self.tMemb.nameSearch.clear()
        memb = tests.mkMember('A', 1, forms=True, campusLink=True,
                              formsDate=Util.convert_date('Qt2DB', QtCore.QDate.currentDate().addDays(1)),
                              campusDate=Util.convert_date('Qt2DB', QtCore.QDate.currentDate().addDays(-10)))
        QTest.keyClicks(self.tMemb.nameSearch, memb['FirstName'] + ' ' + memb['LastName'])
        tests.enterMemberInfo(self, memb)
        self.assertTrue(self.tMemb.Button_addUpdButClick())

        self.ui.tabWid.setCurrentIndex(0)
        setTransGear(self, gear, 'Name')
        setTransMemb(self, memb)

        QTest.mouseClick(self.tTran.payBut, QtCore.Qt.LeftButton)
        QTest.mouseClick(self.tTran.payWind.payBut, QtCore.Qt.LeftButton)
        self.tTran.payWind.close()

        self.tTran.radioOut.click()
        self.assertTrue(self.tTran.trans())
예제 #2
0
    def setUp(self):

        self.app = QtGui.QApplication.instance()
        if self.app is None:
            self.app = QtGui.QApplication(sys.argv)
            self.app.setQuitOnLastWindowClosed(True)
            if os.path.isfile(tests.dBName):
                os.remove(tests.dBName)
        self.ui = GearManager.MainUI(tests.dBName)

        self.ui.defDueDateWin.okBut.click()

        self.ui.tabWid.setCurrentIndex(1)

        self.tMemb = self.ui.tabWid.widget(1)

        self.membA1 = tests.mkMember('A', 1)
        self.membB2 = tests.mkMember('B', 2)
예제 #3
0
    def test_notPaid(self):

        self.ui.tabWid.setCurrentIndex(2)
        gear = tests.mkGear('E', 5)
        tests.enterGearInfo(self, gear)
        QTest.mouseClick(self.tGear.updtBut, QtCore.Qt.LeftButton)

        self.ui.tabWid.setCurrentIndex(1)
        self.tMemb.nameSearch.clear()
        memb = tests.mkMember('V', 6, forms=True, campusLink=True,
                              formsDate=Util.convert_date('Qt2DB', QtCore.QDate.currentDate().addDays(1)),
                              campusDate=Util.convert_date('Qt2DB', QtCore.QDate.currentDate().addDays(-2)))
        QTest.keyClicks(self.tMemb.nameSearch, memb['FirstName'] + ' ' + memb['LastName'])
        tests.enterMemberInfo(self, memb)
        self.assertTrue(self.tMemb.Button_addUpdButClick())

        self.ui.tabWid.setCurrentIndex(0)
        setTransGear(self, gear, 'Name')
        setTransMemb(self, memb)

        self.tTran.radioOut.click()
        self.assertFalse(self.tTran.trans())
예제 #4
0
    def tearDown(self):

        self.ui.tabWid.setCurrentIndex(2)
        self.tGear.gNameIDSearch.clear()
        self.tGear.clear_fields()

        for table in self.ui.db.tableDefs.keys():
            self.ui.db.execQuery('DROP TABLE ' + table, 'tests_trans -> tearDown')
        self.ui.db.close()
        self.app.quit()
        del self.app

#
# --- Transaction Tab tests --------------------------------------------------------------------------------------------
#
membList = [tests.mkMember('A', 1), tests.mkMember('B', 2)]
gearList = [tests.mkGear('A', 1), tests.mkGear('B', 2)]


class TransactionTests(unittest.TestCase):

    def setUp(self):

        self.app = QtGui.QApplication.instance()
        if self.app is None:
            self.app = QtGui.QApplication(sys.argv)
            self.app.setQuitOnLastWindowClosed(True)
            if os.path.isfile(tests.dBName):
                os.remove(tests.dBName)
        self.ui = GearManager.MainUI(tests.dBName)