diff --git a/trytond/trytond/tests/test_ir.py b/trytond/trytond/tests/test_ir.py index 0b7481f959..18c20da69e 100644 --- a/trytond/trytond/tests/test_ir.py +++ b/trytond/trytond/tests/test_ir.py @@ -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()