"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "tests/src/python/test_qgsserver_wfs.py" between
QGIS-final-3_10_11.tar.gz and QGIS-final-3_10_12.tar.gz

About: QGIS (Quantum GIS) is a Geographic Information System that supports vector, raster, and database formats. Long-term release (3.10.x series).

test_qgsserver_wfs.py  (QGIS-final-3_10_11):test_qgsserver_wfs.py  (QGIS-final-3_10_12)
skipping to change at line 517 skipping to change at line 517
encoded_data = post_data.format(field=field, value=value, version=ve rsion).encode('utf8') encoded_data = post_data.format(field=field, value=value, version=ve rsion).encode('utf8')
# Strip the field if NULL # Strip the field if NULL
if value is None: if value is None:
encoded_data = encoded_data.replace(b'<wfs:Value>None</wfs:Value >', b'') encoded_data = encoded_data.replace(b'<wfs:Value>None</wfs:Value >', b'')
header, body = self._execute_request("?MAP=%s&SERVICE=WFS&VERSION=%s " % ( header, body = self._execute_request("?MAP=%s&SERVICE=WFS&VERSION=%s " % (
self.testdata_path + 'test_project_wms_grouped_layers.qgs', vers ion), QgsServerRequest.PostMethod, encoded_data) self.testdata_path + 'test_project_wms_grouped_layers.qgs', vers ion), QgsServerRequest.PostMethod, encoded_data)
if version == '1.0.0': if version == '1.0.0':
self.assertTrue(b'<SUCCESS/>' in body, body) self.assertTrue(b'<SUCCESS/>' in body, body)
else: else:
self.assertTrue(b'<TotalUpdated>1</TotalUpdated>' in body, body) self.assertTrue(b'<totalUpdated>1</totalUpdated>' in body, body)
header, body = self._execute_request("?MAP=%s&SERVICE=WFS&REQUEST=Ge tFeature&TYPENAME=cdb_lines&FEATUREID=cdb_lines.22" % ( header, body = self._execute_request("?MAP=%s&SERVICE=WFS&REQUEST=Ge tFeature&TYPENAME=cdb_lines&FEATUREID=cdb_lines.22" % (
self.testdata_path + 'test_project_wms_grouped_layers.qgs')) self.testdata_path + 'test_project_wms_grouped_layers.qgs'))
if value is not None: if value is not None:
xml_value = '<qgs:{0}>{1}</qgs:{0}>'.format(field, value).encode ('utf8') xml_value = '<qgs:{0}>{1}</qgs:{0}>'.format(field, value).encode ('utf8')
self.assertTrue(xml_value in body, "%s not found in body" % xml_ value) self.assertTrue(xml_value in body, "%s not found in body" % xml_ value)
else: else:
xml_value = '<qgs:{0}>'.format(field).encode('utf8') xml_value = '<qgs:{0}>'.format(field).encode('utf8')
self.assertFalse(xml_value in body) self.assertFalse(xml_value in body)
# Check the backend # Check the backend
vl = QgsVectorLayer( vl = QgsVectorLayer(
skipping to change at line 551 skipping to change at line 551
# "name" is NOT NULL: try to set it to empty string # "name" is NOT NULL: try to set it to empty string
_round_trip('', 'name', version) _round_trip('', 'name', version)
# Then NULL # Then NULL
data = post_data.format(field='name', value='', version=version).enc ode('utf8') data = post_data.format(field='name', value='', version=version).enc ode('utf8')
encoded_data = data.replace(b'<wfs:Value></wfs:Value>', b'') encoded_data = data.replace(b'<wfs:Value></wfs:Value>', b'')
header, body = self._execute_request("?MAP=%s&SERVICE=WFS" % ( header, body = self._execute_request("?MAP=%s&SERVICE=WFS" % (
self.testdata_path + 'test_project_wms_grouped_layers.qgs'), Qgs ServerRequest.PostMethod, encoded_data) self.testdata_path + 'test_project_wms_grouped_layers.qgs'), Qgs ServerRequest.PostMethod, encoded_data)
if version == '1.0.0': if version == '1.0.0':
self.assertTrue(b'<ERROR/>' in body, body) self.assertTrue(b'<ERROR/>' in body, body)
else: else:
self.assertTrue(b'<TotalUpdated>0</TotalUpdated>' in body) self.assertTrue(b'<totalUpdated>0</totalUpdated>' in body)
self.assertTrue(b'<Message>NOT NULL constraint error on layer \'cdb_ lines\', field \'name\'</Message>' in body, body) self.assertTrue(b'<Message>NOT NULL constraint error on layer \'cdb_ lines\', field \'name\'</Message>' in body, body)
def test_describeFeatureTypeGeometryless(self): def test_describeFeatureTypeGeometryless(self):
"""Test DescribeFeatureType with geometryless tables - bug GH-30381""" """Test DescribeFeatureType with geometryless tables - bug GH-30381"""
project_file = "test_project_geometryless_gh30381.qgs" project_file = "test_project_geometryless_gh30381.qgs"
self.wfs_request_compare("DescribeFeatureType", '1.1.0', self.wfs_request_compare("DescribeFeatureType", '1.1.0',
reference_base_name='wfs_describeFeatureType_1_ 1_0_geometryless', reference_base_name='wfs_describeFeatureType_1_ 1_0_geometryless',
project_file=project_file) project_file=project_file)
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)