Test model graph report

This commit is contained in:
Cédric Krier committed 2024-12-23 15:36:47 +01:00
1 parent c715844bb7
commit 0ef20b9571
1 file changed
+21
+21
View File
@@ -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()