From c7ac9653905b5341bff2cfd4b244f449e3569f2c Mon Sep 17 00:00:00 2001 From: Se Yeon Kim Date: Wed, 11 Aug 2021 22:00:23 -0500 Subject: [PATCH] Test address hash with non-default domain Hash should be the address and domain included --- emails/tests/models_tests.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/emails/tests/models_tests.py b/emails/tests/models_tests.py index 4dfca3b865..8eb5039e00 100644 --- a/emails/tests/models_tests.py +++ b/emails/tests/models_tests.py @@ -44,6 +44,12 @@ def test_address_hash_with_subdomain(self): expected_hash = sha256(f'{address}@{subdomain}'.encode('utf-8')).hexdigest() assert address_hash(address, subdomain) == expected_hash + def test_address_hash_with_additional_domain(self): + address = 'aaaaaaaaa' + test_domain = 'test.com' + expected_hash = sha256(f'{address}@{test_domain}'.encode('utf-8')).hexdigest() + assert address_hash(address, domain=test_domain) == expected_hash + class RelayAddressTest(TestCase): def setUp(self):