'Asserts that submitting a CourseEmailTemplateForm with a name that contains
whitespace at the beginning or end of a name is stripped'

def test_name_with_spaces_is_trimmed(self):

    form_data = {'html_template': '{{message_body}}', 'plain_template': '{{message_body}}', 'name': '    foo        '}
    form = CourseEmailTemplateForm(form_data)
    self.assertTrue(form.is_valid())
    form.save()
    cet = CourseEmailTemplate.objects.get(name='foo')
    self.assertIsNotNone(cet)
