From 5d0849d74681deedd71bf6594261941df91c1a16 Mon Sep 17 00:00:00 2001 From: Rick Elrod Date: Wed, 15 Mar 2023 20:49:27 -0700 Subject: [PATCH] [tests] Some survey tests were being skipped (#13703) The class that contained these tests wasn't named Test*, so the tests in it weren't running. Fix that and fix the tests in it so that they pass. Signed-off-by: Rick Elrod --- awx/main/tests/unit/models/test_survey_models.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/awx/main/tests/unit/models/test_survey_models.py b/awx/main/tests/unit/models/test_survey_models.py index 57058930ea..8ac8bcd227 100644 --- a/awx/main/tests/unit/models/test_survey_models.py +++ b/awx/main/tests/unit/models/test_survey_models.py @@ -18,7 +18,7 @@ class DistinctParametrize(object): @pytest.mark.survey -class SurveyVariableValidation: +class TestSurveyVariableValidation: def test_survey_answers_as_string(self, job_template_factory): objects = job_template_factory('job-template-with-survey', survey=[{'variable': 'var1', 'type': 'text'}], persisted=False) jt = objects.job_template @@ -57,7 +57,7 @@ class SurveyVariableValidation: accepted, rejected, errors = obj.accept_or_ignore_variables({"a": 5}) assert rejected == {"a": 5} assert accepted == {} - assert str(errors[0]) == "Value 5 for 'a' expected to be a string." + assert str(errors['variables_needed_to_start'][0]) == "Value 5 for 'a' expected to be a string." def test_job_template_survey_default_variable_validation(self, job_template_factory): objects = job_template_factory( @@ -88,7 +88,7 @@ class SurveyVariableValidation: obj.survey_enabled = True accepted, _, errors = obj.accept_or_ignore_variables({"a": 2}) - assert accepted == {{"a": 2.0}} + assert accepted == {"a": 2.0} assert not errors