summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlassane Yattara <alassane.yattara@savoirfairelinux.com>2023-11-09 16:55:41 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-11-09 17:01:18 +0000
commitdcb6a5cca6ae42bb27cdc56784dc4e32176b9169 (patch)
tree20c4b068f091e114f8e1b9ed7f160d8c29dc356c
parent20705f46af4edb101892b355350265d1c37ba1a2 (diff)
downloadpoky-dcb6a5cca6ae42bb27cdc56784dc4e32176b9169.tar.gz
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 <alassane.yattara@savoirfairelinux.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--bitbake/lib/toaster/tests/functional/test_functional_basic.py2
1 files changed, 2 insertions, 0 deletions
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 @@
8# 8#
9 9
10import re, time 10import re, time
11import pytest
11from django.urls import reverse 12from django.urls import reverse
12from tests.functional.functional_helpers import SeleniumFunctionalTestCase 13from tests.functional.functional_helpers import SeleniumFunctionalTestCase
13from orm.models import Project 14from orm.models import Project
@@ -16,6 +17,7 @@ from selenium.webdriver.common.by import By
16class FuntionalTestBasic(SeleniumFunctionalTestCase): 17class FuntionalTestBasic(SeleniumFunctionalTestCase):
17 18
18# testcase (1514) 19# testcase (1514)
20 @pytest.mark.django_db
19 def test_create_slenium_project(self): 21 def test_create_slenium_project(self):
20 project_name = 'selenium-project' 22 project_name = 'selenium-project'
21 self.get(reverse('newproject')) 23 self.get(reverse('newproject'))