Commit 48063771cc08ce15f76e0bf9caa39dc42204363d

Authored by AlexDiatlov
1 parent 65f78614

test data requirement response procuringEntity qualifications

@@ -1296,3 +1296,46 @@ def test_bid_criteria(tender_data, criteria_len, bid_data, bid_document): @@ -1296,3 +1296,46 @@ def test_bid_criteria(tender_data, criteria_len, bid_data, bid_document):
1296 else: 1296 else:
1297 pass 1297 pass
1298 return bid 1298 return bid
  1299 +
  1300 +
  1301 +def test_data_qualification_criteria():
  1302 + bid = munchify({
  1303 + "data": []
  1304 + })
  1305 + mock = {
  1306 + "description": "qualification Requirement response description",
  1307 + "value": "true",
  1308 + "evidences": [
  1309 + {
  1310 + "relatedDocument": {
  1311 + "id": "",
  1312 + "title": ""
  1313 + },
  1314 + "type": "document",
  1315 + "title": "Evidence of qualification Requirement response"
  1316 + }
  1317 + ],
  1318 + "requirement": {
  1319 + "id": "",
  1320 + "title": ""
  1321 + },
  1322 + "title": "qualification Requirement response title"
  1323 + }
  1324 + return bid, mock
  1325 +
  1326 +
  1327 +def test_qualification_criteria(tender_data, qualification_document):
  1328 + bid, mock = test_data_qualification_criteria()
  1329 + mock = deepcopy(mock)
  1330 + for criteria in tender_data["data"]['criteria']:
  1331 + if criteria.get('source') == 'procuringEntity':
  1332 + for requirement in criteria['requirementGroups'][0]['requirements']:
  1333 + mock = deepcopy(mock)
  1334 + mock["requirement"]["id"] = requirement["id"]
  1335 + mock["requirement"]["title"] = requirement["title"]
  1336 + mock["evidences"][0]["relatedDocument"]["id"] = qualification_document["data"]["id"]
  1337 + mock["evidences"][0]["relatedDocument"]["title"] = qualification_document["data"]["title"]
  1338 + bid.data.append(mock)
  1339 + else:
  1340 + pass
  1341 + return bid
@@ -92,7 +92,8 @@ from .initial_data import ( @@ -92,7 +92,8 @@ from .initial_data import (
92 test_bid_competitive_data_stage_2, 92 test_bid_competitive_data_stage_2,
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 ) 97 )
97 from barbecue import chef 98 from barbecue import chef
98 from restkit import request 99 from restkit import request
Please register or login to post a comment