Files
@ 93889b9694f4
Branch filter:
Location: rattail-project/rattail/tests/test_mail.py - annotation
93889b9694f4
796 B
text/x-python
bump: version 0.18.12 → 0.19.0
eee8e7445f77 328c8377c5ec 20d588f15b3d 20d588f15b3d 328c8377c5ec 328c8377c5ec 328c8377c5ec 328c8377c5ec 328c8377c5ec 20d588f15b3d 328c8377c5ec 328c8377c5ec 328c8377c5ec 20d588f15b3d 328c8377c5ec 328c8377c5ec 20d588f15b3d 20d588f15b3d 20d588f15b3d 328c8377c5ec 328c8377c5ec 328c8377c5ec 82df448ca060 328c8377c5ec ec84bfc7e8e5 | # -*- coding: utf-8; -*-
import os
from unittest import TestCase
from rattail import mail
from rattail.config import RattailConfig
class TestEmail(TestCase):
def test_template_lookup_paths(self):
# default paths
config = RattailConfig()
email = mail.Email(config, 'testing')
self.assertEqual(len(email.html_templates.directories), 1)
path = email.html_templates.directories[0]
self.assertTrue(path.endswith(os.path.join('rattail', 'templates', 'mail')))
# config may specify paths
config = RattailConfig()
config.setdefault('rattail.mail', 'templates', '/tmp/foo /tmp/bar')
email = mail.Email(config, 'testing')
self.assertEqual(email.html_templates.directories, ['/tmp/foo', '/tmp/bar'])
|