dav_base.emails: make coverage happy
Run tests / Execute tox to run the test suite (push) Successful in 3m33s

This commit is contained in:
heinzel committed 2026-05-21 16:29:37 +02:00
1 parent 4d9da28e69
commit 6b9c490f92
3 files changed
+25 -8

No files matched your search

+21 -1
View File
@@ -43,4 +43,24 @@ class TestCase(EmailTestMixin, SimpleTestCase):
self.assertSender(mail)
self.assertRecipients(mail, [recipient])
self.assertSubject(mail, '')
self.assertBody(mail, 'MAILBODY')
self.assertBody(mail, 'MAILBODY\n')
def test_send_extra_context(self):
recipient = 'root@localhost'
class ConcreteMail(AbstractMail): # pylint: disable=too-few-public-methods
_template_name = MAIL_TEMPLATE
def _get_recipients(self):
return [recipient]
def _get_body(self, context=None):
context = {'var1': 'Here is',
'var2': ' extra context. '}
return super()._get_body(context)
email = ConcreteMail()
email.send()
mail = django_mail.outbox[0]
self.assertBody(mail, 'Here is extra context. MAILBODY\n')