[TechDraw] Fix making template bug for tests

This commit is contained in:
Benjamin Bræstrup Sayoc
2022-07-27 17:41:32 +02:00
committed by WandererFan
parent 6893938f2a
commit 48661cd3c7
2 changed files with 3 additions and 7 deletions

View File

@@ -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")

View File

@@ -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")