コード例 #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}))
コード例 #2
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)