diff --git a/tests/system/shared/project.py b/tests/system/shared/project.py
index 6228a9b8f2486860af6eab156eea57b0dd954689..43f5c34d2b21b35941e5d80ee848993812f5a6ac 100644
--- a/tests/system/shared/project.py
+++ b/tests/system/shared/project.py
@@ -449,3 +449,9 @@ def __getSupportedPlatforms__(text, getAsStrings=False):
     if getAsStrings:
         result = QtQuickConstants.getTargetsAsStrings(result)
     return result, version
+
+# copy example project (sourceExample is path to project) to temporary directory inside repository
+def prepareTemplate(sourceExample):
+    templateDir = os.path.abspath(tempDir() + "/template")
+    shutil.copytree(sourceExample, templateDir)
+    return templateDir
diff --git a/tests/system/shared/suites_qtta.py b/tests/system/shared/suites_qtta.py
index c177e0132ac867a6f236aa98e5a9b72228466706..d435b154e7ddcc82b702147369838b1492671a64 100755
--- a/tests/system/shared/suites_qtta.py
+++ b/tests/system/shared/suites_qtta.py
@@ -33,10 +33,3 @@ def checkSyntaxError(issuesView, expectedTextsArray, warnIfMoreIssues = True):
                 else:
                     return True
     return False
-
-# copy example project (sourceExample is path to project) to <temp>/template dir
-def prepareTemplate(sourceExample):
-    templateDir = os.path.abspath(tempDir() + "/template")
-    shutil.copytree(sourceExample, templateDir)
-    return templateDir
-
diff --git a/tests/system/suite_general/tst_create_proj_wizard/test.py b/tests/system/suite_general/tst_create_proj_wizard/test.py
index d62442138e570b52abb264bf0f31482b41d476af..e600f3e7d48600df86cc4d30d2191fbffceebb42 100644
--- a/tests/system/suite_general/tst_create_proj_wizard/test.py
+++ b/tests/system/suite_general/tst_create_proj_wizard/test.py
@@ -7,7 +7,7 @@ def main():
     sourceExample = os.path.abspath(sdkPath + "/Examples/4.7/declarative/text/textselection")
     if not neededFilePresent(sourceExample):
         return
-    prepareTemplate(sourceExample)
+    templateDir = prepareTemplate(sourceExample)
     startApplication("qtcreator" + SettingsPath)
     overrideInstallLazySignalHandler()
     installLazySignalHandler(":frame.templateDescription_QTextBrowser",
@@ -102,12 +102,6 @@ def main():
         clickButton(waitForObject("{text='Cancel' type='QPushButton' unnamed='1' visible='1'}", 20000))
     invokeMenuItem("File", "Exit")
 
-def prepareTemplate(sourceExample):
-    global templateDir
-    templateDir = tempDir()
-    templateDir = os.path.abspath(templateDir + "/template")
-    shutil.copytree(sourceExample, templateDir)
-
 def cleanup():
     global templateDir
     # waiting for a clean exit - for a full-remove of the temp directory
diff --git a/tests/system/suite_qtquick/tst_qml_editor/test.py b/tests/system/suite_qtquick/tst_qml_editor/test.py
index 1b01c3fc00e1aecaca9b033e58b57c6ca85ce86d..38396f7e929daae22732af85c6e93e2a1b623d27 100644
--- a/tests/system/suite_qtquick/tst_qml_editor/test.py
+++ b/tests/system/suite_qtquick/tst_qml_editor/test.py
@@ -14,7 +14,7 @@ def main():
     addHelpDocumentationFromSDK()
     # using a temporary directory won't mess up an eventually exisiting
     workingDir = tempDir()
-    prepareTemplate(sourceExample)
+    templateDir = prepareTemplate(sourceExample)
     prepareForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", "sourceFilesRefreshed(QStringList)")
     installLazySignalHandler("{type='Core::FutureProgress' unnamed='1''}", "finished()", "__handleFutureProgress__")
     createNewQtQuickApplication(workingDir, "untitled", templateDir + "/qml/focus.qml")
@@ -26,12 +26,6 @@ def main():
     test.log("Test finished")
     invokeMenuItem("File", "Exit")
 
-def prepareTemplate(sourceExample):
-    global templateDir
-    templateDir = tempDir()
-    templateDir = os.path.abspath(templateDir + "/template")
-    shutil.copytree(sourceExample, templateDir)
-
 def testRenameId():
     global searchFinished
     test.log("Testing rename of id")
diff --git a/tests/system/suite_qtquick/tst_qtquick_creation2/test.py b/tests/system/suite_qtquick/tst_qtquick_creation2/test.py
index c87cd78ddb9d01c366446f21e307f768c79a6ef9..e590351fb5d4f1f7e125e498d9efad2f3ed8469a 100644
--- a/tests/system/suite_qtquick/tst_qtquick_creation2/test.py
+++ b/tests/system/suite_qtquick/tst_qtquick_creation2/test.py
@@ -11,7 +11,7 @@ def main():
     startApplication("qtcreator" + SettingsPath)
     # using a temporary directory won't mess up an eventually exisiting
     workingDir = tempDir()
-    prepareTemplate(sourceExample)
+    templateDir = prepareTemplate(sourceExample)
     projectName = createNewQtQuickApplication(workingDir, None, templateDir + "/qml/textselection.qml")
     # wait for parsing to complete
     waitForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", "sourceFilesRefreshed(QStringList)")
@@ -50,12 +50,6 @@ def subprocessFunction():
     test.log("Closing QmlApplicationViewer")
     sendEvent("QCloseEvent", "{type='QmlApplicationViewer' unnamed='1' visible='1'}")
 
-def prepareTemplate(sourceExample):
-    global templateDir
-    templateDir = tempDir()
-    templateDir = os.path.abspath(templateDir + "/template")
-    shutil.copytree(sourceExample, templateDir)
-
 def cleanup():
     global workingDir,templateDir
     # waiting for a clean exit - for a full-remove of the temp directory