diff --git a/bench/app.py b/bench/app.py index 315eec6c..47aef9a3 100755 --- a/bench/app.py +++ b/bench/app.py @@ -73,7 +73,7 @@ class AppMeta: def setup_details(self): # fetch meta from installed apps - if hasattr(self, "bench") and os.path.exists( + if self.bench and os.path.exists( os.path.join(self.bench.name, "apps", self.name) ): self.mount_path = os.path.join(self.bench.name, "apps", self.name) diff --git a/bench/tests/test_init.py b/bench/tests/test_init.py index 329fedae..0e2f1964 100755 --- a/bench/tests/test_init.py +++ b/bench/tests/test_init.py @@ -12,6 +12,7 @@ from bench.utils import exec_cmd from bench.release import get_bumped_version from bench.app import App from bench.tests.test_base import FRAPPE_BRANCH, TestBenchBase +from bench.bench import Bench # changed from frappe_theme because it wasn't maintained and incompatible, @@ -43,7 +44,9 @@ class TestBenchInit(TestBenchBase): self.assert_folders(bench_name) self.assert_virtual_env(bench_name) self.assert_config(bench_name) - + test_bench = Bench(bench_name) + app = App("frappe", bench=test_bench) + self.assertEqual(app.from_apps, True) def basic(self): try: