Test model graph report
This commit is contained in:
1 parent
c715844bb7
commit
0ef20b9571
1 file changed
+21
@@ -526,6 +526,27 @@ class IrTestCase(ModuleTestCase):
|
||||
'cc': ['fallback@example.com'],
|
||||
})
|
||||
|
||||
@unittest.skipUnless(
|
||||
pydot and shutil.which('dot'), "pydot is needed to generate graph")
|
||||
@with_transaction()
|
||||
def test_model_graph(self):
|
||||
"Test model graph"
|
||||
pool = Pool()
|
||||
Model = pool.get('ir.model')
|
||||
ModelGraph = pool.get('ir.model.graph', type='report')
|
||||
|
||||
models = Model.search([])
|
||||
|
||||
oext, content, print_, filename = (
|
||||
ModelGraph.execute([m.id for m in models], {
|
||||
'level': 1,
|
||||
'filter': '',
|
||||
}))
|
||||
self.assertEqual(oext, 'png')
|
||||
self.assertTrue(content)
|
||||
self.assertFalse(print_)
|
||||
self.assertEqual(filename, "Graph")
|
||||
|
||||
@unittest.skipUnless(
|
||||
pydot and shutil.which('dot'), "pydot is needed to generate graph")
|
||||
@with_transaction()
|
||||
|
||||
Reference in new issue
Block a user