Commit 51bc08d5723291a74800b42bdf30b03df54b7047

Authored by AlexDiatlov
1 parent 42d9d70c

test data procuringEntity qualification requirement response

@@ -1298,7 +1298,7 @@ def test_bid_criteria(tender_data, criteria_len, bid_data, bid_document): @@ -1298,7 +1298,7 @@ def test_bid_criteria(tender_data, criteria_len, bid_data, bid_document):
1298 return bid 1298 return bid
1299 1299
1300 1300
1301 -def test_data_qualification_criteria(): 1301 +def test_data_qualification_award_criteria():
1302 bid = munchify({ 1302 bid = munchify({
1303 "data": [] 1303 "data": []
1304 }) 1304 })
@@ -1325,7 +1325,7 @@ def test_data_qualification_criteria(): @@ -1325,7 +1325,7 @@ def test_data_qualification_criteria():
1325 1325
1326 1326
1327 def test_qualification_criteria(tender_data, qualification_document): 1327 def test_qualification_criteria(tender_data, qualification_document):
1328 - bid, mock = test_data_qualification_criteria() 1328 + bid, mock = test_data_qualification_award_criteria()
1329 mock = deepcopy(mock) 1329 mock = deepcopy(mock)
1330 for criteria in tender_data["data"]['criteria']: 1330 for criteria in tender_data["data"]['criteria']:
1331 if criteria.get('source') == 'procuringEntity': 1331 if criteria.get('source') == 'procuringEntity':
@@ -1339,3 +1339,20 @@ def test_qualification_criteria(tender_data, qualification_document): @@ -1339,3 +1339,20 @@ def test_qualification_criteria(tender_data, qualification_document):
1339 else: 1339 else:
1340 pass 1340 pass
1341 return bid 1341 return bid
  1342 +
  1343 +
  1344 +def test_awards_criteria(tender_data, award_document):
  1345 + bid, mock = test_data_qualification_award_criteria()
  1346 + mock = deepcopy(mock)
  1347 + for criteria in tender_data["data"]['criteria']:
  1348 + if criteria.get('source') == 'procuringEntity':
  1349 + for requirement in criteria['requirementGroups'][0]['requirements']:
  1350 + mock = deepcopy(mock)
  1351 + mock["requirement"]["id"] = requirement["id"]
  1352 + mock["requirement"]["title"] = requirement["title"]
  1353 + mock["evidences"][0]["relatedDocument"]["id"] = award_document["data"]["id"]
  1354 + mock["evidences"][0]["relatedDocument"]["title"] = award_document["data"]["title"]
  1355 + bid.data.append(mock)
  1356 + else:
  1357 + pass
  1358 + return bid
@@ -93,7 +93,8 @@ from .initial_data import ( @@ -93,7 +93,8 @@ from .initial_data import (
93 test_article_17_data, 93 test_article_17_data,
94 test_data_bid_criteria, 94 test_data_bid_criteria,
95 test_bid_criteria, 95 test_bid_criteria,
96 - test_qualification_criteria 96 + test_qualification_criteria,
  97 + test_awards_criteria
97 ) 98 )
98 from barbecue import chef 99 from barbecue import chef
99 from restkit import request 100 from restkit import request
Please register or login to post a comment