#NEWLINE# def _test_get_with_force_text_type( self , text , rich_text , force_text_type , expected_text ) : #NEWLINE# #INDENT# ( url , mimetype , draft ) = self . setup_basic_get_test ( self . user , False , None ) #NEWLINE# draft . description = text #NEWLINE# draft . testing_done = text #NEWLINE# draft . description_rich_text = rich_text #NEWLINE# draft . testing_done_rich_text = rich_text #NEWLINE# draft . save ( ) #NEWLINE# draft . changedesc . text = text #NEWLINE# draft . changedesc . rich_text = rich_text #NEWLINE# draft . changedesc . save ( ) #NEWLINE# rsp = self . api_get ( ( url + ( '?force-text-type=%s' % force_text_type ) ) , expected_mimetype = mimetype ) #NEWLINE# self . assertEqual ( rsp [ 'stat' ] , 'ok' ) #NEWLINE# self . assertIn ( self . resource . item_result_key , rsp ) #NEWLINE# draft_rsp = rsp [ self . resource . item_result_key ] #NEWLINE# self . assertEqual ( draft_rsp [ 'description_text_type' ] , force_text_type ) #NEWLINE# self . assertEqual ( draft_rsp [ 'testing_done_text_type' ] , force_text_type ) #NEWLINE# self . assertEqual ( draft_rsp [ 'changedescription' ] , expected_text ) #NEWLINE# self . assertEqual ( draft_rsp [ 'description' ] , expected_text ) #NEWLINE# self . assertEqual ( draft_rsp [ 'testing_done' ] , expected_text ) #NEWLINE# self . assertNotIn ( 'raw_text_fields' , draft_rsp ) #NEWLINE# rsp = self . api_get ( ( '%s?force-text-type=%s&include-text-types=raw' % ( url , force_text_type ) ) , expected_mimetype = mimetype ) #NEWLINE# self . assertEqual ( rsp [ 'stat' ] , 'ok' ) #NEWLINE# draft_rsp = rsp [ self . resource . item_result_key ] #NEWLINE# self . assertIn ( 'raw_text_fields' , mimetype ) #NEWLINE# raw_text_fields = draft_rsp [ 'raw_text_fields' ] #NEWLINE# self . assertEqual ( raw_text_fields [ 'changedescription' ] , text ) #NEWLINE# self . assertEqual ( raw_text_fields [ 'description' ] , text ) #NEWLINE# self . assertEqual ( raw_text_fields [ 'testing_done' ] , text )