use CLIN data from EDA client response
This commit is contained in:
parent
6a03664b51
commit
4fefd017a2
@ -29,7 +29,7 @@ class TaskOrders(object):
|
||||
to_data = TaskOrders._client().get_contract(order_number, status="y")
|
||||
if to_data:
|
||||
# TODO: we need to determine exactly what we're getting and storing from the EDA client
|
||||
return TaskOrders.create(number=to_data["contract_no"], source=Source.EDA)
|
||||
return TaskOrders.create(source=Source.EDA, **to_data)
|
||||
|
||||
else:
|
||||
raise NotFoundError("task_order")
|
||||
|
@ -116,18 +116,13 @@ class MockEDAClient(EDAClientBase):
|
||||
def get_contract(self, contract_number, status):
|
||||
if contract_number == self.MOCK_CONTRACT_NUMBER and status == "y":
|
||||
return {
|
||||
"aco_mod": "01",
|
||||
"admin_dodaac": None,
|
||||
"cage_code": "1U305",
|
||||
"contract_no": "DCA10096D0052",
|
||||
"delivery_order": "0084",
|
||||
"duns_number": None,
|
||||
"issue_date": "20000228",
|
||||
"issue_dodaac": None,
|
||||
"location": "https://docsrv1.nit.disa.mil:443/eda/enforcer/C0414345.PDF?ver=1.4&loc=Y29udHJhY3RzL29nZGVuL3ZlbmRvci8xOTk4LzA5LzE0L0MwNDE0MzQ1LlBERg==&sourceurl=aHR0cHM6Ly9lZGE0Lm5pdC5kaXNhLm1pbC9wbHMvdXNlci9uZXdfYXBwLkdldF9Eb2M_cFRhYmxlX0lEPTImcFJlY29yZF9LZXk9OEE2ODExNjM2RUY5NkU2M0UwMzQwMDYwQjBCMjgyNkM=&uid=6CFC2B2322E86FD5E054002264936E3C&qid=19344159&signed=G&qdate=20180529194407GMT&token=6xQICrrrfIMciEJSpXmfsAYrToM=",
|
||||
"pay_dodaac": None,
|
||||
"pco_mod": "02",
|
||||
"amount": 2_000_000,
|
||||
"number": "DCA10096D0052",
|
||||
"clin_0001": 500,
|
||||
"clin_0003": 600,
|
||||
"clin_1001": 700,
|
||||
"clin_1003": 800,
|
||||
"clin_2001": 900,
|
||||
"clin_2003": 1000,
|
||||
}
|
||||
else:
|
||||
return None
|
||||
@ -180,7 +175,10 @@ class EDAClient(EDAClientBase):
|
||||
)
|
||||
if response.text.startswith("No data found"):
|
||||
return None
|
||||
return ET.fromstring(response.text)
|
||||
|
||||
eda_data = {"number": contract_number}
|
||||
eda_data.update(parse_eda_xml(response.text))
|
||||
return eda_data
|
||||
|
||||
def get_clins(self, record_key, clins, cage_code="", duns_number=""):
|
||||
response = self._get(
|
||||
|
@ -11,8 +11,7 @@ def test_list_contracts():
|
||||
|
||||
def test_get_contract():
|
||||
result = mock_client.get_contract("DCA10096D0052", "y")
|
||||
assert result["contract_no"] == "DCA10096D0052"
|
||||
assert result["amount"] == 2_000_000
|
||||
assert result["number"] == "DCA10096D0052"
|
||||
|
||||
|
||||
def test_contract_not_found():
|
||||
|
Loading…
x
Reference in New Issue
Block a user