Skip to content

Commit

Permalink
[ADD] mail_composer_cc_bcc: more helpful error message for test
Browse files Browse the repository at this point in the history
This is a test that compares the hash of the source code of a function they
override with a list of known hashes, so as soon as this changes in upstream,
the test fails and we know we have to check if we need to incorporate any changes
from there.
  • Loading branch information
hbrunn committed Dec 16, 2024
1 parent 5d8a39c commit 35e89eb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion mail_composer_cc_bcc/tests/test_mail_cc_bcc.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,12 @@ def test_upstream_file_hash(self):
"""Test that copied upstream function hasn't received fixes"""
func = inspect.getsource(upstream._send).encode()
func_hash = hashlib.md5(func).hexdigest()
self.assertIn(func_hash, VALID_HASHES)
self.assertIn(
func_hash,
VALID_HASHES,
"mail.mail#_send has changed in upstream, "
"please adapt the override and add the new hash above",
)

def test_email_cc_bcc(self):
form = self.open_mail_composer_form()
Expand Down

0 comments on commit 35e89eb

Please sign in to comment.