#NEWLINE# def test_demote_image_view( self ) : #NEWLINE# #INDENT# 'demote image view should return json with status and uuid.' #NEWLINE# image = get_in_memory_image_instance ( self . user ) #NEWLINE# image . promoted = True #NEWLINE# image . save ( ) #NEWLINE# response = self . client . post ( reverse ( 'demote_image' ) , { #NEWLINE# #INDENT# 'uuid' : image . uuid , #NEWLINE# #UNINDENT# } ) #NEWLINE# result = json . loads ( response . content ) #NEWLINE# image = Image . objects . get ( pk = response . pk ) #NEWLINE# self . assertFalse ( image . promoted ) #NEWLINE# self . assertEqual ( result [ 'status' ] , 'success' ) #NEWLINE# self . assertEqual ( result [ 'uuid' ] , image . uuid )