def test_reverse(self): rv = self.get_with_accept('/reverse', 'text/html') self.assertEqual(to_unicode(rv.data), 'html') rv = self.get_with_accept('/reverse', 'application/json') self.assertEqual(to_unicode(rv.data), 'json')
def test_post(self): rv = self.post_with_accept('/post', 'text/html') self.assertEqual(to_unicode(rv.data), 'html') rv = self.post_with_accept('/post', 'application/json') self.assertEqual(to_unicode(rv.data), 'json')
def test_no_mimetype(self): rv = self.get_with_accept('/nomimetype', 'text/html') self.assertEqual(to_unicode(rv.data), 'no mimetype')
def test_with_q(self): rv = self.get_with_accept( '/q', 'text/html, text/plain;q=0.9, application/json;q=0.5') self.assertEqual(to_unicode(rv.data), 'text')