Ejemplo n.º 1
0
 def renders_simple_greeting_with_one_variable(self):
     context = Context({'name': 'Mjumbe'})
     response = render_to_response(template_name="hello2.txt",
                                   context_instance=context)
     assert_equal(response.content, 'Hello, Mjumbe!\n')
Ejemplo n.º 2
0
 def renders_simple_hello_world(self):
     response = render_to_response(template_name="hello1.txt")
     assert_equal(response.content, 'Hello, World!\n')
Ejemplo n.º 3
0
 def renders_simple_greeting_with_partial(self):
     context = Context({'name': 'Mjumbe'})
     response = render_to_response(template_name="hello5.txt",
                                   context_instance=context)
     assert_equal(response.content, ('Hello, Mjumbe, nice to meet you!\n').encode())