diff --git a/docker/mariadb/create_database_user.py b/docker/mariadb/create_database_user.py index 17bfcc4..6980a30 100644 --- a/docker/mariadb/create_database_user.py +++ b/docker/mariadb/create_database_user.py @@ -38,7 +38,7 @@ cur.execute(sql) print('Granting rights for running Django tests...') -sql = "grant create on *.* to `{}`".format( +sql = "grant create, alter on *.* to `{}`".format( os.environ['DJANGO_DB_USER_NAME']) cur.execute(sql) diff --git a/src/feedback_plugin/tests/test_process_raw_data.py b/src/feedback_plugin/tests/test_process_raw_data.py index 0b77749..d25565c 100644 --- a/src/feedback_plugin/tests/test_process_raw_data.py +++ b/src/feedback_plugin/tests/test_process_raw_data.py @@ -1,6 +1,10 @@ from datetime import datetime, timezone import os -from zoneinfo import ZoneInfo +import sys +if sys.version_info.major == 3 and sys.version_info.minor >= 9: + from zoneinfo import ZoneInfo +else: + from backports.zoneinfo import ZoneInfo from django.test import TestCase @@ -75,8 +79,10 @@ def test_load_fixtures(self): test_data = load_test_data(os.path.join( os.path.dirname(os.path.realpath(__file__)), 'test_data/')) - - create_test_database(test_data) + try: + create_test_database(test_data) + except: + print("Problem with creating the test data.\nPossible missing grants for the user.") self.assertEqual(Upload.objects.all().count(), 8) self.assertEqual(Server.objects.all().count(), 5)