Ejemplo n.º 1
0
	def testFailAssert(self):
		if docnotok:
			with self.assertRaises(Exception) as context:
				d = DocList()
				d.doc = docnotok[0]
				d.children = None
				d.doc.fields['__islocal']=1
				d.save(1)
Ejemplo n.º 2
0
 def testFailAssert(self):
     if docnotok:
         with self.assertRaises(Exception) as context:
             d = DocList()
             d.doc = docnotok[0]
             d.children = None
             d.doc.fields['__islocal'] = 1
             d.save(1)
Ejemplo n.º 3
0
	def testInsert(self):
		d = DocList()

		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)
Ejemplo n.º 4
0
    def testInsert(self):
        d = DocList()

        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)