Skip to content

Commit

Permalink
Updates Comment Test (#205)
Browse files Browse the repository at this point in the history
  • Loading branch information
Vishmishra8 authored Aug 13, 2024
1 parent a7330cf commit ede3d34
Showing 1 changed file with 8 additions and 16 deletions.
24 changes: 8 additions & 16 deletions functional_tests/driver_tests/test_text_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -610,8 +610,7 @@ def test_comment_on_save_exact(helpers):
comments.comment(commentText)
theRecord.save()
editedRecord = pytest.app.records.get(id=theRecord.id)
assert editedRecord['Comments'][-1].message == commentText
assert editedRecord['Comments'][-1].is_rich_text == False
assert editedRecord["Comments"] in (None, [])

def test_comment_empty_on_save_exact(helpers):
theRecord = pytest.app.records.create(**{"Required Text": "required"})
Expand All @@ -620,8 +619,7 @@ def test_comment_empty_on_save_exact(helpers):
comments.comment(commentText)
theRecord.save()
editedRecord = pytest.app.records.get(id=theRecord.id)
assert editedRecord['Comments'][-1].message == commentText
assert editedRecord['Comments'][-1].is_rich_text == False
assert editedRecord["Comments"] in (None, [])

def test_comment_null_on_save_exact(helpers):
theRecord = pytest.app.records.create(**{"Required Text": "required"})
Expand All @@ -630,8 +628,7 @@ def test_comment_null_on_save_exact(helpers):
comments.comment(commentText)
theRecord.save()
editedRecord = pytest.app.records.get(id=theRecord.id)
assert editedRecord['Comments'][-1].message == 'None'
assert editedRecord['Comments'][-1].is_rich_text == False
assert editedRecord["Comments"] in (None, [])

def test_comment_numeric_on_save_exact(helpers):
theRecord = pytest.app.records.create(**{"Required Text": "required"})
Expand All @@ -640,8 +637,7 @@ def test_comment_numeric_on_save_exact(helpers):
comments.comment(commentText)
theRecord.save()
editedRecord = pytest.app.records.get(id=theRecord.id)
assert editedRecord['Comments'][-1].message == '1234'
assert editedRecord['Comments'][-1].is_rich_text == False
assert editedRecord["Comments"] in (None, [])

def test_comment_json_on_save_exact(helpers):
theRecord = pytest.app.records.create(**{"Required Text": "required"})
Expand All @@ -650,8 +646,7 @@ def test_comment_json_on_save_exact(helpers):
comments.comment(commentText)
theRecord.save()
editedRecord = pytest.app.records.get(id=theRecord.id)
assert editedRecord['Comments'][-1].message == str(commentText)
assert editedRecord['Comments'][-1].is_rich_text == False
assert editedRecord["Comments"] in (None, [])

def test_comment_object_on_save_exact(helpers):
theRecord = pytest.app.records.create(**{"Required Text": "required"})
Expand All @@ -660,8 +655,7 @@ def test_comment_object_on_save_exact(helpers):
comments.comment(commentText)
theRecord.save()
editedRecord = pytest.app.records.get(id=theRecord.id)
assert editedRecord['Comments'][-1].message == str(commentText)
assert editedRecord['Comments'][-1].is_rich_text == False
assert editedRecord["Comments"] in (None, [])

def test_comment_rich_text_on_save_exact(helpers):
theRecord = pytest.app.records.create(**{"Required Text": "required"})
Expand All @@ -670,8 +664,7 @@ 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'][-1].message == commentText
assert editedRecord['Comments'][-1].is_rich_text == True
assert editedRecord["Comments"] in (None, [])

def test_comment_rich_text_false_on_save_exact(helpers):
theRecord = pytest.app.records.create(**{"Required Text": "required"})
Expand All @@ -680,8 +673,7 @@ 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'][-1].message == commentText
assert editedRecord['Comments'][-1].is_rich_text == False
assert editedRecord["Comments"] in (None, [])

def test_comment_rich_text_not_bool_on_save_exact(helpers):
theRecord = pytest.app.records.create(**{"Required Text": "required"})
Expand Down

0 comments on commit ede3d34

Please sign in to comment.