diff --git a/g3w-admin/qdjango/tests/base.py b/g3w-admin/qdjango/tests/base.py index a3bd545c1..010be4960 100644 --- a/g3w-admin/qdjango/tests/base.py +++ b/g3w-admin/qdjango/tests/base.py @@ -41,7 +41,6 @@ QGS328_VALUE_RELATION = 'value_relation_qgis328.qgs' QGS328_RELATION_REFERENCE = 'g3wsuite_project_test_qgis328.qgs' - @override_settings( CACHES={ 'default': { @@ -71,6 +70,7 @@ def setUpClass(cls): super().setUpClass() setup_testing_user(cls) + def setUp(self): # main project group diff --git a/g3w-admin/qdjango/tests/test_qgisauth.py b/g3w-admin/qdjango/tests/test_qgisauth.py index 0496d1138..fabb64b5b 100644 --- a/g3w-admin/qdjango/tests/test_qgisauth.py +++ b/g3w-admin/qdjango/tests/test_qgisauth.py @@ -68,7 +68,6 @@ def setUpClass(cls): config.setConfig("username", "my user") config.setConfig("password", "my password") assert config.isValid() - res, cfg = cls.am.storeAuthenticationConfig(config) assert res assert config.id() != '' @@ -83,12 +82,15 @@ def setUp(self): self.fakelayer = Layer.objects.get(name='fakelayer') self.fakelayer_datasource = self.fakelayer.datasource + def tearDown(self): + """Clear DB""" + + self.am.removeAllAuthenticationConfigs() @classmethod def tearDownClass(cls): super().tearDownClass() - cls.am.removeAllAuthenticationConfigs() # Make sure there are no auth files left for path in (AUTH_DB_PATH, MASTER_PASSWORD_PATH): if os.path.isfile(path): @@ -119,6 +121,7 @@ def test_db_methods(self): def test_model(self): """Test QGIS Auth model""" + self.assertEqual(QgisAuth.objects.count(), 0) # Create an auth config