Skip to content

Commit

Permalink
Fix Test for Django 4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
wlorenzetti committed Jan 2, 2025
1 parent 8a8f400 commit 3e93063
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion g3w-admin/qdjango/tests/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
QGS328_VALUE_RELATION = 'value_relation_qgis328.qgs'
QGS328_RELATION_REFERENCE = 'g3wsuite_project_test_qgis328.qgs'


@override_settings(
CACHES={
'default': {
Expand Down Expand Up @@ -71,6 +70,7 @@ def setUpClass(cls):
super().setUpClass()
setup_testing_user(cls)


def setUp(self):

# main project group
Expand Down
7 changes: 5 additions & 2 deletions g3w-admin/qdjango/tests/test_qgisauth.py
Original file line number Diff line number Diff line change
Expand Up @@ -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() != ''
Expand All @@ -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):
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 3e93063

Please sign in to comment.