From 71aa31f9fa0ad07f005104dfa75823fca9842025 Mon Sep 17 00:00:00 2001 From: wmayer Date: Sat, 25 Jun 2022 18:05:23 +0200 Subject: [PATCH] Draft: handle the absence of the Drawing module in the unit tests --- src/Mod/Draft/drafttests/test_modification.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/Mod/Draft/drafttests/test_modification.py b/src/Mod/Draft/drafttests/test_modification.py index f8c85a0d87..9ede7a10ef 100644 --- a/src/Mod/Draft/drafttests/test_modification.py +++ b/src/Mod/Draft/drafttests/test_modification.py @@ -558,13 +558,16 @@ class DraftModification(unittest.TestCase): svg_template = 'Mod/Drawing/Templates/A3_Landscape.svg' template = Draft.get_param("template", App.getResourceDir() + svg_template) - page = App.ActiveDocument.addObject('Drawing::FeaturePage') - page.Template = template - _msg(" Drawing view") - _msg(" page={}".format(page.TypeId)) - _msg(" template={}".format(page.Template)) - obj = Draft.make_drawing_view(prism, page, otherProjection=None) - self.assertTrue(obj, "'{}' failed".format(operation)) + try: + page = App.ActiveDocument.addObject('Drawing::FeaturePage') + page.Template = template + _msg(" Drawing view") + _msg(" page={}".format(page.TypeId)) + _msg(" template={}".format(page.Template)) + obj = Draft.make_drawing_view(prism, page, otherProjection=None) + self.assertTrue(obj, "'{}' failed".format(operation)) + except TypeError: + pass def test_mirror(self): """Create a rectangle, then a mirrored shape."""