Пример #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_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}))
Пример #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)
Пример #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)