[NEW] first commit for all modules coming from training-tools

This commit is contained in:
clementthomas
2023-11-21 12:54:02 +01:00
parent 823f04a7b6
commit 61e01e4be0
94 changed files with 3534 additions and 0 deletions

View File

@@ -0,0 +1 @@
from . import test_survey_contact_generation

View File

@@ -0,0 +1,31 @@
# Copyright 2023 Tecnativa - David Vidal
# Copyright 2023 Tecnativa - Stefan Ungureanu
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo.tests import HttpCase, tagged
from odoo.addons.survey.tests.common import SurveyCase
@tagged("-at_install", "post_install")
class SurveyContactGenerationCase(SurveyCase, HttpCase):
def setUp(self):
"""We run the tour in the setup so we can share the tests case with other
modules"""
super().setUp()
self.survey = self.env.ref("survey_contact_generation.survey_contact_creation")
initial_user_inputs = self.survey.user_input_ids
# Run the survey as a portal user and get the generated quotation
self.start_tour(
f"/survey/start/{self.survey.access_token}",
"test_survey_contact_generation",
)
self.user_input = self.survey.user_input_ids - initial_user_inputs
@tagged("-at_install", "post_install")
class SurveyContactGenerationTests(SurveyContactGenerationCase):
def test_contact_generation(self):
partner = self.env["res.partner"].search(
[("email", "=", "survey_contact_generation@test.com")]
)
self.assertEqual(partner, self.user_input.partner_id)