notifications.tests package#
Submodules#
notifications.tests.common_functions module#
- notifications.tests.common_functions.check_email_sent(manager: CobaltTestManagerIntegration = None, test_name: str = '', test_description: str = '', email_to: str = None, subject_search: str = None, body_search: str = None, email_count: int = 20, debug: bool = False, save_results: bool = True)[source]#
Check if an email has been sent. This isn’t the greatest test going around. Email addresses get changed by the playpen checks and you can also find older emails that match by accident. Emails really need to be manually tested as you need to look at the presentation as well as the content, but this is better than nothing.
NOTE: This is used by both integration tests and smoke tests
Search parameters will combine, e.g. if you provide email_to and subject_search then both need to match for this to succeed.
- Parameters:
manager – standard manager object (only needed if save_results=True)
test_name – Name for this test to appear in report (only needed if save_results=True)
test_description – Description for this test (only needed if save_results=True)
subject_search – string to search for in the email subject
body_search – string to search for in the email body
email_to – first name of person sent the email. Assumes using normal templates for this.
email_count – how many recent emails to look through
debug – print diagnostics
save_results – flag to save results (for integration tests) or not (for smoke tests)