diff --git a/bench/tests/test_base.py b/bench/tests/test_base.py index b5022398..44dc131d 100644 --- a/bench/tests/test_base.py +++ b/bench/tests/test_base.py @@ -11,6 +11,14 @@ import getpass import bench import bench.utils +# imports - third party imports +from six import PY2 + + +if PY2: + FRAPPE_BRANCH = "version-12" +else: + FRAPPE_BRANCH = "develop" class TestBenchBase(unittest.TestCase): def setUp(self): @@ -76,7 +84,7 @@ class TestBenchBase(unittest.TestCase): frappe_tmp_path = "/tmp/frappe" if not os.path.exists(frappe_tmp_path): - bench.utils.exec_cmd("git clone https://github.com/frappe/frappe --depth 1 --origin upstream {location}".format(location=frappe_tmp_path)) + bench.utils.exec_cmd("git clone https://github.com/frappe/frappe -b {branch} --depth 1 --origin upstream {location}".format(branch=FRAPPE_BRANCH, location=frappe_tmp_path)) kwargs.update(dict( python=sys.executable, diff --git a/bench/tests/test_init.py b/bench/tests/test_init.py index 195f90dc..5aabea0e 100755 --- a/bench/tests/test_init.py +++ b/bench/tests/test_init.py @@ -134,11 +134,11 @@ class TestBenchInit(TestBenchBase): bench_path = os.path.join(self.benches_path, "test-bench") app_path = os.path.join(bench_path, "apps", "frappe") - bench.utils.exec_cmd("bench switch-to-branch version-12 frappe", cwd=bench_path) + bench.utils.exec_cmd("bench switch-to-branch version-12 frappe --upgrade", cwd=bench_path) app_branch_after_switch = str(git.Repo(path=app_path).active_branch) self.assertEqual("version-12", app_branch_after_switch) - bench.utils.exec_cmd("bench switch-to-branch develop frappe", cwd=bench_path) + bench.utils.exec_cmd("bench switch-to-branch develop frappe --upgrade", cwd=bench_path) app_branch_after_second_switch = str(git.Repo(path=app_path).active_branch) self.assertEqual("develop", app_branch_after_second_switch)