#NEWLINE# def test_post_with_publish_and_custom_field( self ) : #NEWLINE# #INDENT# 'Testing the POST review-requests/<id>/draft/ API with custom\n        field set in same request and public=1\n        ' #NEWLINE# class CustomField ( BaseReviewRequestField ) : #NEWLINE# #INDENT# can_record_change_entry = True #NEWLINE# field_id = 'my-test' #NEWLINE# #UNINDENT# fieldset = get_review_request_fieldset ( 'info' ) #NEWLINE# fieldset . add_field ( CustomField ) #NEWLINE# review_request = self . create_review_request ( submitter = self . user , publish = True ) #NEWLINE# rsp = self . api_post ( get_review_request_draft_url ( review_request ) , { #NEWLINE# #INDENT# 'extra_data.my-test' : 123 , #NEWLINE# 'public' : True , #NEWLINE# #UNINDENT# } , expected_mimetype = review_request_draft_item_mimetype ) #NEWLINE# self . assertEqual ( rsp [ 'stat' ] , 'ok' ) #NEWLINE# review_request = ReviewRequest . objects . get ( pk = review_request . id ) #NEWLINE# self . assertIn ( 'my-test' , review_request . extra_data ) #NEWLINE# self . assertEqual ( review_request . extra_data [ 'my-test' ] , 123 ) #NEWLINE# self . assertTrue ( review_request . public )