Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix email encoding while handling openinig links in email #125

Merged
merged 1 commit into from
Nov 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/behaving/mail/steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def click_link_in_email(context, address):
assert mails, u"message not found"
mail = email.message_from_string(mails[-1])
links = []
payloads = mail.get_payload()
payloads = mail.get_payload(decode=True).decode("utf-8")
if isinstance(payloads, str):
payloads = [payloads]
for payload in payloads:
Expand Down
2 changes: 1 addition & 1 deletion tests/features/mail.feature
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Feature: Email steps
@web
Scenario: Click link in an email
Given a browser
When I send an email to "[email protected]" with subject "Hello world" and body "Go to https://www.crypho.com"
When I send an email to "[email protected]" with subject "Hello world" and body "Gø tø https://www.crypho.com"
And I click the link in the email I received at "[email protected]"
Then the browser's URL should be "https://www.crypho.com/"

Expand Down