]> git.ipfire.org Git - pbs.git/commitdiff
tests: Add test that tries to send an email
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 14 Oct 2022 14:23:46 +0000 (14:23 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 14 Oct 2022 14:23:46 +0000 (14:23 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
tests/message.py [new file with mode: 0755]

diff --git a/tests/message.py b/tests/message.py
new file mode 100755 (executable)
index 0000000..657c797
--- /dev/null
@@ -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()