From e48bd83c9e00506fd142dc0e15c3a460a385e88e Mon Sep 17 00:00:00 2001 From: SvyatoslavArtymovych Date: Fri, 12 May 2023 11:59:00 +0300 Subject: [PATCH] fix tests --- app/forms/comment.py | 9 +++------ tests/db/create_dummy_data.py | 4 ++-- tests/test_create_dummy_data.py | 4 ++-- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/app/forms/comment.py b/app/forms/comment.py index 19ce66f..e6a1a4a 100644 --- a/app/forms/comment.py +++ b/app/forms/comment.py @@ -1,16 +1,14 @@ from flask_wtf import FlaskForm -from wtforms import StringField, SubmitField, BooleanField +from wtforms import StringField, SubmitField from wtforms.validators import DataRequired, Length class BaseCommentForm(FlaskForm): text = StringField("Text", [DataRequired(), Length(3, 256)]) - marked = BooleanField("Marked") - included_with_interpretation = BooleanField("Included") - parent_id = StringField("Text") class CreateCommentForm(BaseCommentForm): + parent_id = StringField("Text") submit = SubmitField("Create") @@ -19,7 +17,6 @@ class DeleteCommentForm(FlaskForm): submit = SubmitField("Delete") -class EditCommentForm(FlaskForm): +class EditCommentForm(BaseCommentForm): comment_id = StringField("Text") - text = StringField("Text", [DataRequired(), Length(3, 256)]) submit = SubmitField("Edit") diff --git a/tests/db/create_dummy_data.py b/tests/db/create_dummy_data.py index ccaac77..022d2aa 100644 --- a/tests/db/create_dummy_data.py +++ b/tests/db/create_dummy_data.py @@ -150,7 +150,7 @@ def create_dummy_data(): # - comment 2 # - comment 3 # - comment 3.1 (marked) - # - comment 3.2 (included_with_interpretation) + # - comment 3.2 (approved) # - comment 3.3 comment_1 = m.Comment( @@ -197,7 +197,7 @@ def create_dummy_data(): comment_3_2 = m.Comment( text="Dummy Comment 3.2 Text", user_id=user.id, - included_with_interpretation=True, + approved=True, parent_id=comment_3.id, interpretation_id=interpretation_2.id, ).save() diff --git a/tests/test_create_dummy_data.py b/tests/test_create_dummy_data.py index 0242033..462f8fc 100644 --- a/tests/test_create_dummy_data.py +++ b/tests/test_create_dummy_data.py @@ -190,7 +190,7 @@ def test_dummy_data(runner: FlaskCliRunner): # - comment 2 # - comment 3 # - comment 3.1 (marked) - # - comment 3.2 (included_with_interpretation) + # - comment 3.2 (approved) # - comment 3.3 comment_1: m.Comment = m.Comment.query.filter_by( @@ -243,7 +243,7 @@ def test_dummy_data(runner: FlaskCliRunner): assert comment_3_2 in comment_3.children assert comment_3_3 in comment_3.children assert comment_3_1.marked - assert comment_3_2.included_with_interpretation + assert comment_3_2.approved assert comment_1 in interpretation_2.comments assert comment_2 in interpretation_2.comments