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())
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(2) self.tGear = self.ui.tabWid.widget(2) self.gearA1 = tests.mkGear('A', 1) # Clear the current member and member fields self.tGear.gNameIDSearch.clear() self.tGear.clear_fields()
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) self.ui.defDueDateWin.okBut.click()