From 19c3b110883bcccd593c9764cf384f20c12ffb94 Mon Sep 17 00:00:00 2001 From: Vishmishra8 <139379114+Vishmishra8@users.noreply.github.com> Date: Tue, 13 Aug 2024 16:49:07 +0530 Subject: [PATCH] Revert "Updates Comment Test (#205)" (#206) This reverts commit ede3d3442c17b166362cd14d350b58e61911deda. --- .../driver_tests/test_text_fields.py | 24 ++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/functional_tests/driver_tests/test_text_fields.py b/functional_tests/driver_tests/test_text_fields.py index e7d91cc..c3c2155 100644 --- a/functional_tests/driver_tests/test_text_fields.py +++ b/functional_tests/driver_tests/test_text_fields.py @@ -610,7 +610,8 @@ def test_comment_on_save_exact(helpers): comments.comment(commentText) theRecord.save() editedRecord = pytest.app.records.get(id=theRecord.id) - assert editedRecord["Comments"] in (None, []) + assert editedRecord['Comments'][-1].message == commentText + assert editedRecord['Comments'][-1].is_rich_text == False def test_comment_empty_on_save_exact(helpers): theRecord = pytest.app.records.create(**{"Required Text": "required"}) @@ -619,7 +620,8 @@ def test_comment_empty_on_save_exact(helpers): comments.comment(commentText) theRecord.save() editedRecord = pytest.app.records.get(id=theRecord.id) - assert editedRecord["Comments"] in (None, []) + assert editedRecord['Comments'][-1].message == commentText + assert editedRecord['Comments'][-1].is_rich_text == False def test_comment_null_on_save_exact(helpers): theRecord = pytest.app.records.create(**{"Required Text": "required"}) @@ -628,7 +630,8 @@ def test_comment_null_on_save_exact(helpers): comments.comment(commentText) theRecord.save() editedRecord = pytest.app.records.get(id=theRecord.id) - assert editedRecord["Comments"] in (None, []) + assert editedRecord['Comments'][-1].message == 'None' + assert editedRecord['Comments'][-1].is_rich_text == False def test_comment_numeric_on_save_exact(helpers): theRecord = pytest.app.records.create(**{"Required Text": "required"}) @@ -637,7 +640,8 @@ def test_comment_numeric_on_save_exact(helpers): comments.comment(commentText) theRecord.save() editedRecord = pytest.app.records.get(id=theRecord.id) - assert editedRecord["Comments"] in (None, []) + assert editedRecord['Comments'][-1].message == '1234' + assert editedRecord['Comments'][-1].is_rich_text == False def test_comment_json_on_save_exact(helpers): theRecord = pytest.app.records.create(**{"Required Text": "required"}) @@ -646,7 +650,8 @@ def test_comment_json_on_save_exact(helpers): comments.comment(commentText) theRecord.save() editedRecord = pytest.app.records.get(id=theRecord.id) - assert editedRecord["Comments"] in (None, []) + assert editedRecord['Comments'][-1].message == str(commentText) + assert editedRecord['Comments'][-1].is_rich_text == False def test_comment_object_on_save_exact(helpers): theRecord = pytest.app.records.create(**{"Required Text": "required"}) @@ -655,7 +660,8 @@ def test_comment_object_on_save_exact(helpers): comments.comment(commentText) theRecord.save() editedRecord = pytest.app.records.get(id=theRecord.id) - assert editedRecord["Comments"] in (None, []) + assert editedRecord['Comments'][-1].message == str(commentText) + assert editedRecord['Comments'][-1].is_rich_text == False def test_comment_rich_text_on_save_exact(helpers): theRecord = pytest.app.records.create(**{"Required Text": "required"}) @@ -664,7 +670,8 @@ def test_comment_rich_text_on_save_exact(helpers): comments.comment(commentText, rich_text=True) theRecord.save() editedRecord = pytest.app.records.get(id=theRecord.id) - assert editedRecord["Comments"] in (None, []) + assert editedRecord['Comments'][-1].message == commentText + assert editedRecord['Comments'][-1].is_rich_text == True def test_comment_rich_text_false_on_save_exact(helpers): theRecord = pytest.app.records.create(**{"Required Text": "required"}) @@ -673,7 +680,8 @@ def test_comment_rich_text_false_on_save_exact(helpers): comments.comment(commentText, rich_text=False) theRecord.save() editedRecord = pytest.app.records.get(id=theRecord.id) - assert editedRecord["Comments"] in (None, []) + assert editedRecord['Comments'][-1].message == commentText + assert editedRecord['Comments'][-1].is_rich_text == False def test_comment_rich_text_not_bool_on_save_exact(helpers): theRecord = pytest.app.records.create(**{"Required Text": "required"})