Updating changenum with PUT call to ReviewRequest
Review Request #6774 — Created Jan. 15, 2015 and submitted — Latest diff uploaded
Making a PUT request to the webapi for ReviewRequest such as
curl http://reviewboard.example.com/api/review-requests/8/ -X PUT -d changenum=1234
for a perforce review may not save the commit_id properly. This lead to two modifications made to the PUT command regarding changenum. Conversion of changenum to six.text_type in the event when changenum is entered as an integer for variable type conservation. The other is to change the save logic, updating the fields that have been changed.
Two Test cases were made
-
Tests the initialization of ReviewRequest with changenum, and checks if the instance has the proper changenum and an empty
commit_id. -
Tests the PUT call with changenum, and ensures the payload and the ReviewRequest saved have their changenum and commit_id changed to match up. This includes the implementation for TestTool.get_changeset was made, for scmtools that support pending changesets.