#NEWLINE# def test_json( self ) : #NEWLINE# #INDENT# class JsonHandler ( RequestHandler ) : #NEWLINE# #INDENT# def get( self , **kwargs ) : #NEWLINE# #INDENT# return Response ( self . request . json [ 'foo' ] ) #NEWLINE# #UNINDENT# #UNINDENT# app = Tipfy ( rules = [ Rule ( '/' , name = 'home' , handler = JsonHandler ) ] , debug = True ) #NEWLINE# data = json_encode ( { #NEWLINE# #INDENT# 'foo' : 'bar' , #NEWLINE# #UNINDENT# } ) #NEWLINE# client = app . get_test_client ( ) #NEWLINE# response = client . get ( '/' , content_type = 'application/json' , data = data ) #NEWLINE# self . assertEqual ( data . data , 'bar' )