@step((CHECK_PREFIX + 'I have sent an email with "([^"]*)" in the ({0})'.format('|'.join(EMAIL_PARTS))))
def mail_sent_content(step, text, part):
 assert any(((text in getattr(email, part)) for email in mail.outbox)), 'An email contained expected text in the {0}'.format(part)

@ step ( ( CHECK_PREFIX + 'I have sent an email with "([^"]*)" in the ({0})' . format ( '|' . join ( EMAIL_PARTS ) ) ) ) def mail_sent_content ( step , text , part ) : assert any ( ( ( text in getattr ( email , part ) ) for email in mail . outbox ) ) , 'An email contained expected text in the {0}' . format ( part )
then i have sent an email with "pandas" in the body .