Skip to content

Commit

Permalink
[QOLDEV-312] fix data request email assertion
Browse files Browse the repository at this point in the history
- It appears that Behave doesn't fill persona placeholders if they're only part of the argument
  • Loading branch information
ThrawnCA committed Sep 6, 2023
1 parent 718290f commit 09a0427
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion test/features/comments.feature
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Feature: Comments
Then I should see an element with xpath "//h3[contains(string(), 'Add a comment')]"
When I submit a comment with subject "Testing Data Request comment" and comment "This is a test data request comment"
And I wait for 5 seconds
Then I should receive a base64 email at "dr_admin@localhost" containing both "Data request subject: $last_generated_title" and "Comment: This is a test data request comment"
Then I should receive a base64 email at "dr_admin@localhost" containing both "Data request subject: Test Title" and "Comment: This is a test data request comment"

@comment-add @comment-profane
Scenario: When a logged-in user submits a comment containing profanity on a Dataset they should receive an error message and the comment will not appear
Expand Down
2 changes: 1 addition & 1 deletion test/features/steps/steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ def filter_contents(mail):
else:
import base64
decoded_payload = six.ensure_text(base64.b64decode(six.ensure_binary(payload_bytes)))
print('decoded_payload: ', decoded_payload)
print('Searching for', text, ' and ', text2, ' in decoded_payload: ', decoded_payload)
return text in decoded_payload and (not text2 or text2 in decoded_payload)

assert context.mail.user_messages(address, filter_contents)
Expand Down

0 comments on commit 09a0427

Please sign in to comment.