Skip to content

Commit

Permalink
Add test for plus in request body
Browse files Browse the repository at this point in the history
  • Loading branch information
arnaud-morvan committed Feb 19, 2020
1 parent ced0ed4 commit 3af491d
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/src/python/test_qgsserver_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,21 @@ def _check_links(params, method='GET'):
_check_links(params)
_check_links(params, 'POST')

def test_fcgiRequestBody(self):
"""Test request body"""
data = '<Literal>+1</Literal>'
self._set_env({
'SERVER_NAME': 'www.myserver.com',
'SERVICE': 'WFS',
'REQUEST_BODY': data,
'CONTENT_LENGTH': str(len(data)),
'REQUEST_METHOD': 'POST',
})
request = QgsFcgiServerRequest()
response = QgsBufferServerResponse()
self.server.handleRequest(request, response)
self.assertEqual(request.parameter('REQUEST_BODY'), '<Literal>+1</Literal>')

def test_add_parameters(self):
request = QgsServerRequest()
request.setParameter('FOOBAR', 'foobar')
Expand Down

0 comments on commit 3af491d

Please sign in to comment.