summaryrefslogtreecommitdiff
path: root/addons/survey/tests
diff options
context:
space:
mode:
authorVictor Feyens <vfe@odoo.com>2019-03-28 16:46:44 +0000
committerVictor Feyens <vfe@odoo.com>2019-04-25 14:17:45 +0000
commit50caae5bc02bc6eaa1b4a4dfd965c84c940bb84b (patch)
tree15b80bf599dc2bf615e2621566370d41d28f99b9 /addons/survey/tests
parent28e1686bc5c862802162606527a190e344014591 (diff)
[REF] survey: replace dynamic survey.stage by a static state on survey.survey
Stages modification through the clickable statusbar wasn't very intuitive. By fixing default behavior through states (and corresponding buttons), default user experience is simplified. 3 static states available : draft, open, closed Form view: navigation through states with buttons Kanban view: disabled modification of survey state Task ID : 1949110 closes odoo/odoo#32325 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Diffstat (limited to 'addons/survey/tests')
-rw-r--r--addons/survey/tests/common.py2
-rw-r--r--addons/survey/tests/test_certification_flow.py2
-rw-r--r--addons/survey/tests/test_survey_compute_pages_questions.py2
-rw-r--r--addons/survey/tests/test_survey_flow.py2
-rw-r--r--addons/survey/tests/test_survey_invite.py2
5 files changed, 5 insertions, 5 deletions
diff --git a/addons/survey/tests/common.py b/addons/survey/tests/common.py
index d0a7942ade7..71af5d8d4d0 100644
--- a/addons/survey/tests/common.py
+++ b/addons/survey/tests/common.py
@@ -68,7 +68,7 @@ class SurveyCase(common.SavepointCase):
'access_mode': 'public',
'users_login_required': True,
'users_can_go_back': False,
- 'stage_id': self.env['survey.stage'].search([('closed', '=', False)]).id,
+ 'state': 'open',
})
self.page_0 = self.env['survey.question'].sudo(self.survey_manager).create({
'title': 'First page',
diff --git a/addons/survey/tests/test_certification_flow.py b/addons/survey/tests/test_certification_flow.py
index e596e34fa7d..b1db33ec215 100644
--- a/addons/survey/tests/test_certification_flow.py
+++ b/addons/survey/tests/test_certification_flow.py
@@ -51,7 +51,7 @@ class TestCertificationFlow(common.SurveyCase, HttpCase):
'certification_mail_template_id': self.env.ref('survey.mail_template_certification').id,
'is_time_limited': True,
'time_limit': 10,
- 'stage_id': self.env['survey.stage'].search([('closed', '=', False)]).id
+ 'state': 'open',
})
q01 = self._add_question(
diff --git a/addons/survey/tests/test_survey_compute_pages_questions.py b/addons/survey/tests/test_survey_compute_pages_questions.py
index 3b48fb509f3..3fd54cc00fa 100644
--- a/addons/survey/tests/test_survey_compute_pages_questions.py
+++ b/addons/survey/tests/test_survey_compute_pages_questions.py
@@ -9,7 +9,7 @@ class TestSurveyComputePagesQuestions(common.SurveyCase):
with self.sudo(self.survey_manager):
survey = self.env['survey.survey'].create({
'title': 'Test compute survey',
- 'stage_id': self.env['survey.stage'].search([('closed', '=', False)]).id
+ 'state': 'open',
})
page_0 = self.env['survey.question'].create({
diff --git a/addons/survey/tests/test_survey_flow.py b/addons/survey/tests/test_survey_flow.py
index b2d8c6f09c6..35247902c76 100644
--- a/addons/survey/tests/test_survey_flow.py
+++ b/addons/survey/tests/test_survey_flow.py
@@ -34,7 +34,7 @@ class TestSurveyFlow(common.SurveyCase, HttpCase):
'access_mode': 'public',
'users_login_required': False,
'questions_layout': 'page_per_section',
- 'stage_id': self.env['survey.stage'].search([('closed', '=', False)]).id
+ 'state': 'open'
})
# First page is about customer data
diff --git a/addons/survey/tests/test_survey_invite.py b/addons/survey/tests/test_survey_invite.py
index 5b530c15734..4f5224e6872 100644
--- a/addons/survey/tests/test_survey_invite.py
+++ b/addons/survey/tests/test_survey_invite.py
@@ -34,7 +34,7 @@ class TestSurveyInvite(common.SurveyCase):
# closed
self.env['survey.survey'].sudo(self.survey_manager).create({
'title': 'S0',
- 'stage_id': self.env['survey.stage'].search([('sequence', '=', 3)]).id,
+ 'state': 'closed',
'question_and_page_ids': [
(0, 0, {'is_page': True, 'title': 'P0', 'sequence': 1}),
(0, 0, {'title': 'Q0', 'sequence': 2, 'question_type': 'free_text'})