djblets.mail.testing¶
Testing utilities for mail-related unit tests.
- class DmarcDnsTestsMixin[source]¶
Bases:
object
Mixin to help with e-mail tests that need to perform DMARC lookups.
This mixin makes it easy for unit tests to fake DMARC results, in order to prevent the need from looking up real data from real records.
Unit tests can provide a mapping from domain names to TXT record strings in the
dmarc_txt_records
dictionary. When a DMARC lookup is performed, this dictionary will be used for the lookup.Note that this mixin will also clear the memory cache before each test run.
- dmarc_txt_records: Dict[str, Union[bytes, str]]¶
A dictionary of domain names to DMARC TXT record data.
- Type:
- __annotations__ = {'dmarc_txt_records': 'Dict[str, Union[bytes, str]]'}¶