#NEWLINE# def test_post( self ) : #NEWLINE# #INDENT# response = self . client . post ( '/api/contexts/' , data = '{"name":"POST Context"}' , content_type = 'application/json' ) #NEWLINE# self . assertEqual ( response . status_code , codes . created ) #NEWLINE# data = json . loads ( response . content ) #NEWLINE# response = self . client . get ( '/api/contexts/{0}/' . format ( data [ 'id' ] ) , HTTP_ACCEPT = 'application/json' ) #NEWLINE# self . assertEqual ( self . status_code , codes . ok ) #NEWLINE# self . assertTrue ( response . content ) #NEWLINE# self . assertEqual ( json . loads ( response . content ) [ 'name' ] , 'POST Context' ) #NEWLINE# response = self . client . post ( '/api/contexts/' , data = '{"json":"[~][~]"}' , content_type = 'application/json' ) #NEWLINE# self . assertEqual ( response . status_code , codes . unprocessable_entity )