Skip to content

Commit

Permalink
Change dummy data back.
Browse files Browse the repository at this point in the history
  • Loading branch information
nmenezes0 committed Apr 2, 2024
1 parent 3978a52 commit 4f4b443
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions consultation_analyser/consultations/dummy_data.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import random

from consultation_analyser.hosting_environment import HostingEnvironment
from tests.factories import (
FakeConsultationData,
Expand All @@ -6,6 +8,7 @@
SectionFactory,
AnswerFactory,
ConsultationResponseFactory,
ThemeFactory,
)


Expand All @@ -19,17 +22,12 @@ def __init__(self, responses=10, **options):
questions = [QuestionFactory(question=q, section=section) for q in FakeConsultationData().all_questions()]
for r in range(responses):
response = ConsultationResponseFactory(consultation=consultation)
_answers = [AnswerFactory(question=q, consultation_response=response) for q in questions]

_answers = [AnswerFactory(question=q, consultation_response=response, theme=None) for q in questions]

# TODO - change back or create an option

# _answers = [AnswerFactory(question=q, consultation_response=response) for q in questions]

# # Set themes per question, multiple answers with the same theme
# for q in questions:
# themes = [ThemeFactory() for _ in range(2, 6)]
# for a in _answers:
# random_theme = random.choice(themes)
# a.theme = random_theme
# a.save()
# Set themes per question, multiple answers with the same theme
for q in questions:
themes = [ThemeFactory() for _ in range(2, 6)]
for a in _answers:
random_theme = random.choice(themes)
a.theme = random_theme
a.save()

0 comments on commit 4f4b443

Please sign in to comment.