From: Michael Tremer Date: Fri, 14 Oct 2022 14:23:46 +0000 (+0000) Subject: tests: Add test that tries to send an email X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0cb570be36a7d9831bd88a6e14601ce6e19ceea6;p=pbs.git tests: Add test that tries to send an email Signed-off-by: Michael Tremer --- diff --git a/tests/message.py b/tests/message.py new file mode 100755 index 00000000..657c797d --- /dev/null +++ b/tests/message.py @@ -0,0 +1,23 @@ +#!/usr/bin/python3 + +import unittest + +import test + +class MessageTestCase(test.TestCase): + """ + Tests everything around messages + """ + async def test_create_from_source(self): + """ + Test whether we can send a message from template + """ + with self.db.transaction(): + self.user._send_welcome_email() + + # There should now be one message in the queue + self.assertEqual(len(self.backend.messages.queue), 1) + + +if __name__ == "__main__": + unittest.main()