aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlassane Yattara <alassane.yattara@savoirfairelinux.com>2023-10-25 21:17:41 +0100
committerAlassane Yattara <alassane.yattara@savoirfairelinux.com>2023-11-09 18:34:50 +0100
commit120c04645af9b4e700d5015c4e983f3a568d9f70 (patch)
tree1d8f54e9b21cd8115c11f2818791530a3bcf0bb5
parent279221880367536afebd10beb6c9d6bd833bddde (diff)
downloadbitbake-contrib-120c04645af9b4e700d5015c4e983f3a568d9f70.tar.gz
Toaster: fixed pytest error: Database access not allowed, use the "django_db"
Pytest failed on functional/test_functional_basic because database access not allowed - we should use "django_db" fixture to allowed db access Note: Pytest-django takes a conservative approach to enabling database access. By default your tests will fail if they try to access the database. Only if you explicitly request database access will this be allowed. https://pytest-django.readthedocs.io/en/latest/helpers.html#pytest-mark-django-db-request-database-access Signed-off-by: Alassane Yattara <alassane.yattara@savoirfairelinux.com>
-rw-r--r--lib/toaster/tests/functional/test_functional_basic.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/toaster/tests/functional/test_functional_basic.py b/lib/toaster/tests/functional/test_functional_basic.py
index b0def544a..7e9be91ca 100644
--- a/lib/toaster/tests/functional/test_functional_basic.py
+++ b/lib/toaster/tests/functional/test_functional_basic.py
@@ -8,6 +8,7 @@
#
import re, time
+import pytest
from django.urls import reverse
from tests.functional.functional_helpers import SeleniumFunctionalTestCase
from orm.models import Project
@@ -16,6 +17,7 @@ from selenium.webdriver.common.by import By
class FuntionalTestBasic(SeleniumFunctionalTestCase):
# testcase (1514)
+ @pytest.mark.django_db
def test_create_slenium_project(self):
project_name = 'selenium-project'
self.get(reverse('newproject'))