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}))
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)