Exemple #1
0
    def test_render_errors(self):
        for source, target in ('', ''), ('abc', ''), ('', 'xyz'):
            resp = app.get_response('/render?source=%s&target=%s' % (source, target))
            self.assertEquals(400, resp.status_int, resp.body)

        # no Response
        resp = app.get_response('/render?source=abc&target=xyz')
        self.assertEquals(404, resp.status_int)

        # no source data
        Response(id='abc xyz').put()
        resp = app.get_response('/render?source=abc&target=xyz')
        self.assertEquals(404, resp.status_int)
Exemple #2
0
 def test_render_atom(self):
     Response(id='abc xyz', source_atom=self.atom).put()
     resp = app.get_response('/render?source=abc&target=xyz')
     self.assertEquals(200, resp.status_int)
     self.assert_multiline_equals(self.html,
                                  resp.body.decode('utf-8'),
                                  ignore_blanks=True)