Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
wlorenzetti committed Dec 12, 2024
1 parent 44f6915 commit af83f38
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
20 changes: 10 additions & 10 deletions g3w-admin/editing/tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1596,23 +1596,23 @@ def test_editing_commit_mode_api_cascade_relations(self):
newid = jresult['response']['new'][0]['id']
newlockid = jresult['response']['new_lockids'][0]['lockid']

newid_mantaince_work = jresult['response']['new_relations'][maintenance_works_id]['new'][0]['id']
newlockid_mantaince_work = jresult['response']['new_relations'][maintenance_works_id]['new_lockids'][0]['lockid']
newid_mantaince_work = jresult['response']['relations'][maintenance_works_id]['new'][0]['id']
newlockid_mantaince_work = jresult['response']['relations'][maintenance_works_id]['new_lockids'][0]['lockid']

newid_mantaince_rel1 = jresult['response']['new_relations'][maintenance_rel1_id]['new'][0]['id']
newlockid_mantaince_rel1 = jresult['response']['new_relations'][maintenance_rel1_id]['new_lockids'][0][
newid_mantaince_rel1 = jresult['response']['relations'][maintenance_rel1_id]['new'][0]['id']
newlockid_mantaince_rel1 = jresult['response']['relations'][maintenance_rel1_id]['new_lockids'][0][
'lockid']

newid_mantaince_rel2 = jresult['response']['new_relations'][maintenance_rel2_id]['new'][0]['id']
newlockid_mantaince_rel2 = jresult['response']['new_relations'][maintenance_rel2_id]['new_lockids'][0][
newid_mantaince_rel2 = jresult['response']['relations'][maintenance_rel2_id]['new'][0]['id']
newlockid_mantaince_rel2 = jresult['response']['relations'][maintenance_rel2_id]['new_lockids'][0][
'lockid']

newid_rating = jresult['response']['new_relations'][buildings_rating_id]['new'][0]['id']
newlockid_reiting = jresult['response']['new_relations'][buildings_rating_id]['new_lockids'][0][
newid_rating = jresult['response']['relations'][buildings_rating_id]['new'][0]['id']
newlockid_reiting = jresult['response']['relations'][buildings_rating_id]['new_lockids'][0][
'lockid']

newid_rating_rel1 = jresult['response']['new_relations'][rating_rel1_id]['new'][0]['id']
newlockid_reiting_rel1 = jresult['response']['new_relations'][rating_rel1_id]['new_lockids'][0][
newid_rating_rel1 = jresult['response']['relations'][rating_rel1_id]['new'][0]['id']
newlockid_reiting_rel1 = jresult['response']['relations'][rating_rel1_id]['new_lockids'][0][
'lockid']


Expand Down
6 changes: 3 additions & 3 deletions g3w-admin/editing/tests/test_api_transaction_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -511,14 +511,14 @@ def test_add_feature_relations(self):
self.assertTrue('properties' in jresult['response']['new'][0])
self.assertEqual(jresult['response']['new'][0]['properties']['name'], "name father")
self.assertEqual(jresult['response']['new'][0]['properties']['value'], 4444)
self.assertNotEqual(jresult['response']['new_relations'], {})
self.assertNotEqual(jresult['response']['relations'], {})

# Verify
parent_id_server = jresult['response']['new'][0]['id']
parent_id = get_layer_fids_from_server_fids([parent_id_server], self.poligoni.qgis_layer)[0]
self.assertTrue(
self.poligoni.qgis_layer.getFeature(parent_id).isValid())
child_id_server = jresult['response']['new_relations']['test_afb61649_1fb2_426e_b588_04217314f0c4']['new'][0]['id']
child_id_server = jresult['response']['relations']['test_afb61649_1fb2_426e_b588_04217314f0c4']['new'][0]['id']
child_id = get_layer_fids_from_server_fids([child_id_server], self.test.qgis_layer)[0]
self.assertTrue(
self.test.qgis_layer.getFeature(child_id).isValid())
Expand All @@ -531,7 +531,7 @@ def test_add_feature_relations(self):
# There is no cascade here! Delete the child.
response = client.post(child_commit_path, {
"delete": [child_id_server],
"lockids": jresult['response']['new_relations']['test_afb61649_1fb2_426e_b588_04217314f0c4']['new_lockids']
"lockids": jresult['response']['relations']['test_afb61649_1fb2_426e_b588_04217314f0c4']['new_lockids']
}, format='json')

self.assertTrue(json.loads(response.content)['result'])
Expand Down

0 comments on commit af83f38

Please sign in to comment.