I removed this code and fixed the testcase.  It also highlighted a problem on the server side which I have created pull requests for.