You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

customer_tests.py 646B

12345678910111213141516171819
  1. from django.test import TestCase
  2. from oscar.apps.customer.models import CommunicationEventType
  3. class CommunicationTypeTest(TestCase):
  4. keys = ('body', 'html', 'sms', 'subject')
  5. def test_no_templates_returns_empty_string(self):
  6. et = CommunicationEventType()
  7. messages = et.get_messages()
  8. for key in self.keys:
  9. self.assertEqual('', messages[key])
  10. def test_field_template_render(self):
  11. et = CommunicationEventType(email_subject_template='Hello {{ name }}')
  12. ctx = {'name': 'world'}
  13. messages = et.get_messages(ctx)
  14. self.assertEqual('Hello world', messages['subject'])