def test_template_variables_still_work_over_multiple_lines(self): template = Template( "Hello %firstname%!\n Is your lastname %lastname%?") template.variables = {'firstname': 'Michael', 'lastname': 'McMillan'} self.assertEqual(template.text, 'Hello Michael!\n Is your lastname McMillan?')
def test_template_can_contain_percentage_sign_without_a_defined_variables( self): template = Template('Hello %greeting% 5% remains!') template.variables = {'greeting': 'there'} self.assertEqual(template.text, 'Hello there 5% remains!')
def test_template_variable_can_be_used_multiple_times(self): template = Template('Hello %name%. Do you like the name %name%?') template.variables = {'name': 'Michael'} self.assertEqual(template.text, 'Hello Michael. Do you like the name Michael?')
def test_template_can_replace_variables_with_values(self): template = Template('Hello %firstname% %lastname%!') template.variables = {'firstname': 'Michael', 'lastname': 'McMillan'} self.assertEqual(template.text, 'Hello Michael McMillan!')
def test_template_variables_still_work_over_multiple_lines(self): template = Template("Hello %firstname%!\n Is your lastname %lastname%?") template.variables = {'firstname': 'Michael', 'lastname': 'McMillan'} self.assertEqual(template.text, 'Hello Michael!\n Is your lastname McMillan?')
def test_template_can_contain_percentage_sign_without_a_defined_variables(self): template = Template('Hello %greeting% 5% remains!') template.variables = {'greeting': 'there'} self.assertEqual(template.text, 'Hello there 5% remains!')