UPD: added dedicated test template for email test.
This commit is contained in:
1
dav_base/templates/dav_base/tests/mail.txt
Normal file
1
dav_base/templates/dav_base/tests/mail.txt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
This template is used by the automatic software tests.
|
||||||
@@ -5,6 +5,8 @@ from django.test import SimpleTestCase
|
|||||||
from ..emails import AbstractMail
|
from ..emails import AbstractMail
|
||||||
from .generic import EmailTestMixin
|
from .generic import EmailTestMixin
|
||||||
|
|
||||||
|
MAIL_TEMPLATE = 'dav_base/tests/mail.txt'
|
||||||
|
|
||||||
|
|
||||||
class TestCase(EmailTestMixin, SimpleTestCase):
|
class TestCase(EmailTestMixin, SimpleTestCase):
|
||||||
def test_no_template_configured(self):
|
def test_no_template_configured(self):
|
||||||
@@ -17,7 +19,7 @@ class TestCase(EmailTestMixin, SimpleTestCase):
|
|||||||
|
|
||||||
def test_no_get_recipients_implemented(self):
|
def test_no_get_recipients_implemented(self):
|
||||||
class ConcreteMail(AbstractMail):
|
class ConcreteMail(AbstractMail):
|
||||||
_template_name = 'dav_base/base.html'
|
_template_name = MAIL_TEMPLATE
|
||||||
|
|
||||||
email = ConcreteMail()
|
email = ConcreteMail()
|
||||||
with self.assertRaises(NotImplementedError):
|
with self.assertRaises(NotImplementedError):
|
||||||
@@ -27,7 +29,7 @@ class TestCase(EmailTestMixin, SimpleTestCase):
|
|||||||
recipient = 'root@localhost'
|
recipient = 'root@localhost'
|
||||||
|
|
||||||
class ConcreteMail(AbstractMail):
|
class ConcreteMail(AbstractMail):
|
||||||
_template_name = 'dav_base/base.html'
|
_template_name = MAIL_TEMPLATE
|
||||||
|
|
||||||
def _get_recipients(self):
|
def _get_recipients(self):
|
||||||
return [recipient]
|
return [recipient]
|
||||||
|
|||||||
Reference in New Issue
Block a user