Exemple #1
0
	def setUp(self):
		con = dabo.db.dConnection(DbType="Oracle", User="******",
				password="******", Database="XE",
				Host="athlon28")
		self.cur = con.getDaboCursor()
		self.temp_table_name = "unittest%s" % getRandomUUID().replace("-", "")[-17:]
		super(Test_dCursorMixin_oracle, self).setUp()
Exemple #2
0
	def setUp(self):
		# We set up a test connection to an in-memory sqlite database, and then we
		# make a dBizobj against the test table, and then we create a dForm with some
		# dTextBox's to test the interaction.
		self.con = dabo.db.dConnection(DbType="SQLite", Database=":memory:")
		biz = self.biz = dabo.biz.dBizobj(self.con)
		uniqueName = getRandomUUID().replace("-", "")[-20:]
		self.temp_table_name = "unittest%s" % uniqueName
		self.temp_child_table_name = "ut_child%s" % uniqueName
		self.createSchema()
		biz.UserSQL = "select * from %s" % self.temp_table_name
		biz.KeyField = "pk"
		biz.DataSource = self.temp_table_name
		biz.requery()

		## set up the ui elements:
		app = self.app = dApp(MainFormClass=None)
		app.setup()
		frm = self.frm = dabo.ui.dForm(Caption="test_dForm")
		frm.addObject(dabo.ui.dTextBox, DataSource=biz.DataSource, DataField="cField", RegID="cField")
		frm.addObject(dabo.ui.dTextBox, DataSource=biz.DataSource, DataField="nField", RegID="nField")
		frm.addObject(dabo.ui.dTextBox, DataSource=biz.DataSource, DataField="iField", RegID="iField")

		## connect the biz to the frm:
		frm.addBizobj(biz)

		## force the frm to get the first record:
		frm.first()
		frm.update(interval=0)  ## need to force the update here because it is delayed by default, which doesn't work for scripted tests.
Exemple #3
0
	def setUp(self):
		con = dabo.db.dConnection(DbType="MySQL", User="******",
				password="******", Database="dabo_unittest",
				Host="paulmcnett.com")
		self.cur = con.getDaboCursor()
		self.temp_table_name = "unittest%s" % getRandomUUID().replace("-", "")[-17:]
		super(Test_dCursorMixin_mysql, self).setUp()
Exemple #4
0
	def setUp(self):
		# We set up a test connection to an in-memory sqlite database, and then we
		# make a dBizobj against the test table, and then we create a dForm with some
		# dTextBox's to test the interaction.
		self.con = dabo.db.dConnection(DbType="SQLite", Database=":memory:")
		biz = self.biz = dabo.biz.dBizobj(self.con)
		uniqueName = getRandomUUID().replace("-", "")[-20:]
		self.temp_table_name = "unittest%s" % uniqueName
		self.temp_child_table_name = "ut_child%s" % uniqueName
		self.createSchema()
		biz.UserSQL = "select * from %s" % self.temp_table_name
		biz.KeyField = "pk"
		biz.DataSource = self.temp_table_name
		biz.requery()

		## set up the ui elements:
		app = self.app = dApp(MainFormClass=None)
		app.setup()
		frm = self.frm = dabo.ui.dForm(Caption="test_dForm")
		frm.addObject(dabo.ui.dTextBox, DataSource=biz.DataSource, DataField="cField", RegID="cField")
		frm.addObject(dabo.ui.dTextBox, DataSource=biz.DataSource, DataField="nField", RegID="nField")
		frm.addObject(dabo.ui.dTextBox, DataSource=biz.DataSource, DataField="iField", RegID="iField")

		## connect the biz to the frm:
		frm.addBizobj(biz)

		## force the frm to get the first record:
		frm.first()
		frm.update(interval=0)  ## need to force the update here because it is delayed by default, which doesn't work for scripted tests.
Exemple #5
0
	def setUp(self):
		con = dabo.db.dConnection(DbType="Oracle", User="******",
				password="******", Database="XE",
				Host="athlon28")
		self.cur = con.getDaboCursor()
		self.temp_table_name = "unittest%s" % getRandomUUID().replace("-", "")[-17:]
		super(Test_dCursorMixin_oracle, self).setUp()
Exemple #6
0
	def setUp(self):
		con = dabo.db.dConnection(DbType="MySQL", User="******",
				password="******", Database="dabo_unittest",
				Host="paulmcnett.com")
		self.cur = con.getDaboCursor()
		self.temp_table_name = "unittest%s" % getRandomUUID().replace("-", "")[-17:]
		super(Test_dCursorMixin_mysql, self).setUp()
Exemple #7
0
	def setUp(self):
		con = dabo.db.dConnection(DbType="SQLite", Database=":memory:")
		self.cur = con.getDaboCursor()
		self.temp_table_name = "unittest%s" % getRandomUUID().replace("-", "")[-17:]
		super(Test_dCursorMixin_sqlite, self).setUp()
Exemple #8
0
	def setUp(self):
		con = dabo.db.dConnection(DbType="SQLite", Database=":memory:")
		self.cur = con.getDaboCursor()
		self.temp_table_name = "unittest%s" % getRandomUUID().replace("-", "")[-17:]
		super(Test_dCursorMixin_sqlite, self).setUp()