Exemple #1
0
 def test_json(self):
     value = "mickey mouse"
     template = templates.from_string("{{name}}")
     resp = GingerResponse(self.request, template, {"name": value},
                           content_type="application/json")
     content = resp.render().content
     self.assertEqual(content, json.dumps({"name": value}))
Exemple #2
0
 def test_json(self):
     value = "mickey mouse"
     template = templates.from_string("{{name}}")
     resp = GingerResponse(self.request,
                           template, {"name": value},
                           content_type="application/json")
     content = resp.render().content
     self.assertEqual(content, json.dumps({"name": value}))
Exemple #3
0
 def test_html(self):
     value = "mickey mouse"
     template = templates.from_string("{{name}}")
     resp = GingerResponse(self.request, template, {"name": value})
     content = resp.render().content
     self.assertEqual(content, value)
Exemple #4
0
 def test_html(self):
     value = "mickey mouse"
     template = templates.from_string("{{name}}")
     resp = GingerResponse(self.request, template, {"name": value})
     content = resp.render().content
     self.assertEqual(content, value)