Skip to content

Commit 5ff0c3f

Browse files
author
Christian Jensen
authored
Add in a utility function to clear out emails (#19)
Having this utility function is useful so the list of sent emails can be cleared out when starting a Real Human test run.
1 parent be0b120 commit 5ff0c3f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/mail_panel/utils.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,9 @@ def save_outbox(outbox):
1313
Saves the dictionary of cached mail and sets expiry.
1414
"""
1515
cache.set(MAIL_TOOLBAR_CACHE_KEY, outbox, MAIL_TOOLBAR_TTL)
16+
17+
def clear_outbox():
18+
"""
19+
Utility function to clear the dictionary of cached mail. Typical use case: Starting a new real-human test session.
20+
"""
21+
cache.set(MAIL_TOOLBAR_CACHE_KEY, {})

0 commit comments

Comments
 (0)