Jump to >


Testing utilities for mail-related unit tests.

class DmarcDnsTestsMixin[source]

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.


A dictionary of domain names to DMARC TXT record strings.