code: def mail_sent_content(self, text, part):
      
      if not any(text in getattr(email, part) for email in mail.outbox):
          dump_emails(part)
          raise AssertionError(
              "No email contained expected text in the {0}.".format(part))
docs: 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