diff --git a/frappe/tests/test_commands.py b/frappe/tests/test_commands.py index fdab89e4d4..1db25069ad 100644 --- a/frappe/tests/test_commands.py +++ b/frappe/tests/test_commands.py @@ -17,9 +17,14 @@ def clean(value): return value -class BaseTestCommands: - def execute(self, command): - command = command.format(**{"site": frappe.local.site}) +class BaseTestCommands(unittest.TestCase): + def execute(self, command, kwargs): + site = {"site": frappe.local.site} + if kwargs: + kwargs.update(site) + else: + kwargs = site + command = command.replace("\n", " ").format(**kwargs) command = shlex.split(command) self._proc = subprocess.run(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE) self.stdout = clean(self._proc.stdout)