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

[NFC] Extend send email test to cover for contact tokens being replaced #21386

Merged
merged 1 commit into from
Sep 7, 2021

Conversation

seamuslee001
Copy link
Contributor

Overview

This adds a test to verify the fix in #21385 for the problem identified from this merge #21365

Before

Test doesn't cover contact tokens

After

Test covers contact tokens

ping @eileenmcnaughton @demeritcowboy

@civibot
Copy link

civibot bot commented Sep 6, 2021

(Standard links)

@eileenmcnaughton
Copy link
Contributor

thanks @seamuslee001

@seamuslee001
Copy link
Contributor Author

Note test fail expected as test run started before #21385 was merged but for posterity it was

CRM_Activity_BAO_ActivityTest::testSendEmailBasic
Mr. Anthony Anderson .  not found in  MIME-Version: 1.0
From: testSendEmailBasic@example.com
To: Anthony Anderson <anthony_anderson@civicrm.org>
Subject: testSendEmailBasic subject
Reply-To: testSendEmailBasic@example.com
Date: Mon, 06 Sep 2021 23:50:02 +0000
Content-Type: multipart/alternative;
 boundary="=_ef5401fa5e67ad9df6fca008245cd7d1"

--=_ef5401fa5e67ad9df6fca008245cd7d1
Content-Transfer-Encoding: 8bit
Content-Type: text/plain; charset=utf-8

testSendEmailBasic text {contact.display_name}
--=_ef5401fa5e67ad9df6fca008245cd7d1
Content-Transfer-Encoding: 8bit
Content-Type: text/html; charset=utf-8

testSendEmailBasic html {contact.display_name}
--=_ef5401fa5e67ad9df6fca008245cd7d1--
  
Failed asserting that 'MIME-Version: 1.0\n
From: testSendEmailBasic@example.com\n
To: Anthony Anderson <anthony_anderson@civicrm.org>\n
Subject: testSendEmailBasic subject\n
Reply-To: testSendEmailBasic@example.com\n
Date: Mon, 06 Sep 2021 23:50:02 +0000\n
Content-Type: multipart/alternative;\n
 boundary="=_ef5401fa5e67ad9df6fca008245cd7d1"\n
\n
--=_ef5401fa5e67ad9df6fca008245cd7d1\n
Content-Transfer-Encoding: 8bit\n
Content-Type: text/plain; charset=utf-8\n
\n
testSendEmailBasic text {contact.display_name}\n
--=_ef5401fa5e67ad9df6fca008245cd7d1\n
Content-Transfer-Encoding: 8bit\n
Content-Type: text/html; charset=utf-8\n
\n
testSendEmailBasic html {contact.display_name}\n
--=_ef5401fa5e67ad9df6fca008245cd7d1--\n
' contains "Mr. Anthony Anderson".

@seamuslee001
Copy link
Contributor Author

Jenkins re test this please

@eileenmcnaughton eileenmcnaughton merged commit b192487 into civicrm:master Sep 7, 2021
@eileenmcnaughton eileenmcnaughton deleted the test_sendemail branch September 7, 2021 03:20
@demeritcowboy
Copy link
Contributor

Thanks. When I get a minute I might put up a PR to have a copy of the test without the tokens, since we've seen elsewhere there's code that sometimes assumes there's always a token present.

@eileenmcnaughton
Copy link
Contributor

@demeritcowboy yeah good thinking!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants