@step(CHECK_PREFIX + (r'<STR_LIT>')<EOL>.format('<STR_LIT:|>'.join(EMAIL_PARTS)))<EOL>def mail_sent_content(self, text, part):
if not any(text in getattr(email, part) for email in mail.outbox):<EOL><INDENT>dump_emails(part)<EOL>raise AssertionError(<EOL>"<STR_LIT>".format(part))<EOL><DEDENT>
Test an email contains (assert text in) the given text in the relevant
message part (accessible as an attribute on the email object).

This step strictly applies whitespace.

Syntax:

    I have sent an email with "`text`" in the `part`

Example:

.. code-block:: gherkin

    Then I have sent an email with "pandas" in the body