From 48661cd3c763fd2d90383014f589e8bbfe9cfbb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Br=C3=A6strup=20Sayoc?= Date: Wed, 27 Jul 2022 17:41:32 +0200 Subject: [PATCH] [TechDraw] Fix making template bug for tests --- src/Mod/TechDraw/TDTest/DrawViewSymbolTest.py | 2 +- src/Mod/TechDraw/TDTest/TechDrawTestUtilities.py | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/Mod/TechDraw/TDTest/DrawViewSymbolTest.py b/src/Mod/TechDraw/TDTest/DrawViewSymbolTest.py index f9343b608a..ed172f1273 100644 --- a/src/Mod/TechDraw/TDTest/DrawViewSymbolTest.py +++ b/src/Mod/TechDraw/TDTest/DrawViewSymbolTest.py @@ -12,7 +12,7 @@ class DrawViewSymbolTest(unittest.TestCase): FreeCAD.newDocument("TDAnno") FreeCAD.setActiveDocument("TDAnno") FreeCAD.ActiveDocument = FreeCAD.getDocument("TDAnno") - self.page = createPageWithSVGTemplate("TDAnno") + self.page = createPageWithSVGTemplate() def tearDown(self): FreeCAD.closeDocument("TDAnno") diff --git a/src/Mod/TechDraw/TDTest/TechDrawTestUtilities.py b/src/Mod/TechDraw/TDTest/TechDrawTestUtilities.py index 930ed39764..41fa866faa 100644 --- a/src/Mod/TechDraw/TDTest/TechDrawTestUtilities.py +++ b/src/Mod/TechDraw/TDTest/TechDrawTestUtilities.py @@ -3,14 +3,10 @@ import FreeCAD import os -def createPageWithSVGTemplate( - templateName: str = "TestTemplate.svg", -): +def createPageWithSVGTemplate(): """Returns a page with an SVGTemplate added on the ActiveDocument""" - print("2") path = os.path.dirname(os.path.abspath(__file__)) - print("TDTestAnno path: " + path) - templateFileSpec = path + templateName + templateFileSpec = path + "/TestTemplate.svg" page = FreeCAD.ActiveDocument.addObject("TechDraw::DrawPage", "Page") FreeCAD.ActiveDocument.addObject("TechDraw::DrawSVGTemplate", "Template")