.
This commit is contained in:
parent
39ab4c4824
commit
7aeca7a45a
@ -189,7 +189,7 @@ def _build_expanded_rows(
|
|||||||
file_name=file_name,
|
file_name=file_name,
|
||||||
operation_index=operation_index,
|
operation_index=operation_index,
|
||||||
record_id=record_id,
|
record_id=record_id,
|
||||||
operation_fields={},
|
operation_fields=operation_rows[0],
|
||||||
participant_fields=participant_fields,
|
participant_fields=participant_fields,
|
||||||
is_continuation=True,
|
is_continuation=True,
|
||||||
)
|
)
|
||||||
|
|||||||
@ -208,10 +208,12 @@ def test_parse_xml_expands_documents_and_eio_into_additive_rows() -> None:
|
|||||||
base_row.participant_fields["УчастникЮЛ.СведЕИО.ФЛЕИО.ИННФЛИП"]
|
base_row.participant_fields["УчастникЮЛ.СведЕИО.ФЛЕИО.ИННФЛИП"]
|
||||||
== "111111111111"
|
== "111111111111"
|
||||||
)
|
)
|
||||||
assert second_document.operation_fields == {}
|
assert second_document.operation_fields == base_row.operation_fields
|
||||||
assert second_document.is_continuation
|
assert second_document.is_continuation
|
||||||
assert second_document.participant_fields == {"Документ.НомДок": "DOC-2"}
|
assert second_document.participant_fields == {"Документ.НомДок": "DOC-2"}
|
||||||
|
assert third_document.operation_fields == base_row.operation_fields
|
||||||
assert third_document.participant_fields == {"Документ.НомДок": "DOC-3"}
|
assert third_document.participant_fields == {"Документ.НомДок": "DOC-3"}
|
||||||
|
assert second_eio.operation_fields == base_row.operation_fields
|
||||||
assert second_eio.participant_fields == {
|
assert second_eio.participant_fields == {
|
||||||
"УчастникЮЛ.СведЕИО.ЮЛЕИО.ИННЮЛ": "2222222222"
|
"УчастникЮЛ.СведЕИО.ЮЛЕИО.ИННЮЛ": "2222222222"
|
||||||
}
|
}
|
||||||
@ -247,6 +249,41 @@ def test_parse_xml_separates_single_eio_and_single_beneficiary() -> None:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def test_beneficiary_continuation_keeps_full_operation_context() -> None:
|
||||||
|
xml = _base_xml(
|
||||||
|
"""
|
||||||
|
<Операция>
|
||||||
|
<ИдентификаторЗаписи>OP-BENEFICIARY</ИдентификаторЗаписи>
|
||||||
|
<НомерОперация>ЦФТ-БАНК_1361473945637</НомерОперация>
|
||||||
|
<СумОперации>1500.00</СумОперации>
|
||||||
|
<УчастникОп>
|
||||||
|
<ТипУчастника>1</ТипУчастника>
|
||||||
|
<УчастникЮЛ>
|
||||||
|
<БенефициарЮЛ>
|
||||||
|
<ФЛБенефициар><ИННФЛИП>111111111111</ИННФЛИП></ФЛБенефициар>
|
||||||
|
</БенефициарЮЛ>
|
||||||
|
<БенефициарЮЛ>
|
||||||
|
<ФЛБенефициар><ИННФЛИП>222222222222</ИННФЛИП></ФЛБенефициар>
|
||||||
|
</БенефициарЮЛ>
|
||||||
|
</УчастникЮЛ>
|
||||||
|
</УчастникОп>
|
||||||
|
</Операция>
|
||||||
|
"""
|
||||||
|
)
|
||||||
|
|
||||||
|
result = parse_xml_content("SKO115FZ_01_123456789_20260616_X00001.xml", xml)
|
||||||
|
|
||||||
|
assert len(result.rows) == 2
|
||||||
|
main_row, beneficiary_continuation = result.rows
|
||||||
|
assert beneficiary_continuation.is_continuation
|
||||||
|
assert beneficiary_continuation.operation_fields == main_row.operation_fields
|
||||||
|
assert (
|
||||||
|
beneficiary_continuation.operation_fields["НомерОперация"]
|
||||||
|
== "ЦФТ-БАНК_1361473945637"
|
||||||
|
)
|
||||||
|
assert beneficiary_continuation.operation_fields["СумОперации"] == "1500.00"
|
||||||
|
|
||||||
|
|
||||||
def test_operation_repeats_are_collapsed_once_for_two_participants() -> None:
|
def test_operation_repeats_are_collapsed_once_for_two_participants() -> None:
|
||||||
xml = _base_xml(
|
xml = _base_xml(
|
||||||
"""
|
"""
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user