Needn't workaround when invoking `app.request()`

As the issue has been fixed in webtest, we needn't do the workaround
anymore when invoking `app.request`.

Change-Id: I06821c9b5d16d98e888aae329b9c9458d02e86f0
This commit is contained in:
Dave Chen 2015-03-20 00:07:20 +08:00
parent f7c92a13f4
commit a322c4d8c1
1 changed files with 2 additions and 9 deletions

View File

@ -12,9 +12,6 @@
# License for the specific language governing permissions and limitations
# under the License.
import io
from oslo_serialization import jsonutils
import six
import webtest
@ -85,16 +82,12 @@ class RestfulTestCase(tests.TestCase):
if token:
headers['X-Auth-Token'] = str(token)
# setting body this way because of:
# https://github.com/Pylons/webtest/issues/71
if body:
kwargs['body_file'] = io.BytesIO(body)
# sets environ['REMOTE_ADDR']
kwargs.setdefault('remote_addr', 'localhost')
response = app.request(path, headers=headers,
status=expected_status, **kwargs)
status=expected_status, body=body,
**kwargs)
return response