From dcb6a5cca6ae42bb27cdc56784dc4e32176b9169 Mon Sep 17 00:00:00 2001 From: Alassane Yattara Date: Thu, 9 Nov 2023 16:55:41 +0100 Subject: bitbake: 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 (Bitbake rev: 5f92a6b13cdea26b26ff939e9a3f746f7d0937b7) Signed-off-by: Alassane Yattara Signed-off-by: Richard Purdie --- bitbake/lib/toaster/tests/functional/test_functional_basic.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bitbake/lib/toaster/tests/functional/test_functional_basic.py b/bitbake/lib/toaster/tests/functional/test_functional_basic.py index b0def544ae..7e9be91ca1 100644 --- a/bitbake/lib/toaster/tests/functional/test_functional_basic.py +++ b/bitbake/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')) -- cgit v1.2.3-54-g00ecf