diff --git a/.github/workflows/qc_checks.yaml b/.github/workflows/qc_checks.yaml index 4c4b311e35..6b8c1b5473 100644 --- a/.github/workflows/qc_checks.yaml +++ b/.github/workflows/qc_checks.yaml @@ -185,9 +185,7 @@ jobs: postgres: name: Tests - DB [PostgreSQL] runs-on: ubuntu-20.04 - needs: [ 'javascript', 'html', 'pre-commit' ] - if: github.event_name == 'push' env: INVENTREE_DB_ENGINE: django.db.backends.postgresql diff --git a/InvenTree/plugin/test_plugin.py b/InvenTree/plugin/test_plugin.py index 4df129bc0d..76ddc46b68 100644 --- a/InvenTree/plugin/test_plugin.py +++ b/InvenTree/plugin/test_plugin.py @@ -191,6 +191,10 @@ class InvenTreePluginTests(TestCase): class RegistryTests(TestCase): """Tests for registry loading methods.""" + def mockDir(self) -> None: + """Returns path to mock dir""" + return str(Path(__file__).parent.joinpath('mock').absolute()) + def run_package_test(self, directory): """General runner for testing package based installs.""" @@ -223,7 +227,7 @@ class RegistryTests(TestCase): def test_subfolder_loading(self): """Test that plugins in subfolders get loaded.""" - self.run_package_test('InvenTree/plugin/mock') + self.run_package_test(self.mockDir()) def test_folder_loading(self): """Test that plugins in folders outside of BASE_DIR get loaded.""" @@ -232,7 +236,7 @@ class RegistryTests(TestCase): with tempfile.TemporaryDirectory() as tmp: # Fill directory with sample data new_dir = Path(tmp).joinpath('mock') - shutil.copytree(Path('InvenTree/plugin/mock').absolute(), new_dir) + shutil.copytree(self.mockDir(), new_dir) # Run tests self.run_package_test(str(new_dir))