diff --git a/profiles/tests/api/test_answer.py b/profiles/tests/api/test_answer.py index 764457a..3ab1460 100644 --- a/profiles/tests/api/test_answer.py +++ b/profiles/tests/api/test_answer.py @@ -34,7 +34,7 @@ def test_post_answer(api_client_authenticated, users, questions, options): assert response.status_code == 201 assert Answer.objects.count() == 1 user.refresh_from_db() - assert user.result.value == "negative result" + assert user.result.topic == "negative" @pytest.mark.django_db @@ -129,7 +129,7 @@ def test_answer_get_result(api_client_authenticated, users, answers): url = reverse("profiles:answer-get-result") response = api_client_authenticated.get(url) assert response.status_code == 200 - assert response.json()["value"] == "negative result" + assert response.json()["topic"] == "negative" @pytest.mark.django_db diff --git a/profiles/tests/api/test_postal_code_result.py b/profiles/tests/api/test_postal_code_result.py index 4d5b195..3db622c 100644 --- a/profiles/tests/api/test_postal_code_result.py +++ b/profiles/tests/api/test_postal_code_result.py @@ -19,8 +19,8 @@ def test_postal_code_result(api_client, questions, sub_questions, options, resul start_poll_url = reverse("profiles:question-start-poll") end_poll_url = reverse("profiles:question-end-poll") answer_url = reverse("profiles:answer-list") - positive_result = results.get(value="positive result") - negative_result = results.get(value="negative result") + positive_result = results.get(topic="positive") + negative_result = results.get(topic="negative") question1 = questions.get(number="1") question2 = questions.get(number="2") car_sub_q = sub_questions.get(question=question2, description="car") diff --git a/profiles/tests/api/test_question.py b/profiles/tests/api/test_question.py index 4fe56dc..acf9078 100644 --- a/profiles/tests/api/test_question.py +++ b/profiles/tests/api/test_question.py @@ -287,8 +287,8 @@ def test_questions(api_client, questions, question_conditions, options, results) == question.options.first().results.count() ) assert ( - json_response["options"][0]["results"][0]["value"] - == results.filter(options__question=question).first().value + json_response["options"][0]["results"][0]["topic"] + == results.filter(options__question=question).first().topic ) diff --git a/profiles/tests/conftest.py b/profiles/tests/conftest.py index d276249..6e4ff7a 100644 --- a/profiles/tests/conftest.py +++ b/profiles/tests/conftest.py @@ -63,8 +63,8 @@ def sub_questions(questions): @pytest.mark.django_db @pytest.fixture def options(questions, sub_questions, results): - positive_result = results.get(value="positive result") - negative_result = results.get(value="negative result") + positive_result = results.get(topic="positive") + negative_result = results.get(topic="negative") question1 = questions.get(number="1") option_no = Option.objects.create(value="no", question=question1) option_no.results.add(negative_result) @@ -93,8 +93,8 @@ def options(questions, sub_questions, results): @pytest.mark.django_db @pytest.fixture def results(): - Result.objects.create(topic="negative", value="negative result") - Result.objects.create(topic="positive", value="positive result") + Result.objects.create(topic="negative", description="negative result") + Result.objects.create(topic="positive", description="positive result") return Result.objects.all()