예제 #1
0
	def testFailAssert(self):
		if docnotok:
			with self.assertRaises(Exception) as context:
				d = Bean()
				d.doc = docnotok[0]
				d.children = None
				d.doc.fields['__islocal']=1
				d.save(1)
예제 #2
0
	def testInsert(self):
		d = Bean()

		count_before =  flt(sql("select count(*) from tab"+_doctype)[0][0])
		if docok:
			for i in docok:
				d.doc = i
				d.children = None
				d.doc.fields['__islocal']=1
				d.save(1)
		count_after = flt(sql("select count(*) from tab"+_doctype)[0][0])
		self.assertTrue(count_before+len(docok)==count_after)