A duplicate upload name got the counter appended to the previous
candidate and after the extension: pay.xml_1, then pay.xml_1_2,
pay.xml_1_2_3. Keep the extension and number from the original name:
pay_1.xml, pay_2.xml.
Add 97 tests:
- account_ebics: order numbers, camt and CFONB split per account,
journal lookup, duplicate statements, download and upload wizards,
key initialisation (INI/HIA/HPB), passphrase change, admin orders.
- account_ebics_batch: scheduled import, import log, reprocess.
- account_ebics_payment_order / account_ebics_batch_payment: upload of
the payment file and link to the payment document.
- account_ebics_statement_import_test (new, test-only, not to install
in production): installs the OCA camt and CFONB parsers in CI and
runs the end-to-end statement import.
The bank is simulated by patching ebics.xfer._setup_client, or the
fintech client classes for the key initialisation; keys, certificates
and the INI letter are real, created in a temporary directory.
The keyring was built outside the try block, and fintech raises the
passphrase error from the EbicsKeyRing constructor: a wrong passphrase
showed a raw ValueError traceback instead of "Passphrase mismatch.".
When another keyring instance on the same file is still open in the
worker, fintech raises RuntimeError instead, which is now caught too.
The note was not initialised, so a failed client setup raised a
TypeError on note += ...; and functional errors were not caught, showing
a raw traceback. Initialise the note and report EbicsFunctionalError
like EbicsTechnicalError.
The pain.002 unlink hook raised NotImplementedError, so no EBICS file
with that processing method could be deleted. Make it a no-op
placeholder like the other formats.
ZZZZ is accepted by the order number constraint, but the next number was
computed as 0000, which the constraint then rejects, blocking H003
uploads. Wrap it to A000 like ZZZY already does.
The ondelete guard checked state "active", which ebics.config does not
have (draft/confirm), so confirmed configurations could be deleted.
Same check as on 19.0.
_process_bank_statement_oe commits after each statement. Under tests this
left the test transaction. Skip the commit when the registry is in test
mode or the current thread is a test thread.
The xpath result was indexed before the emptiness check, so a statement
without IBAN or other account id raised an IndexError instead of the
"No bank account number found." notification.
The error was noted but processing went on with root.nsmap, raising an
AttributeError. Unparseable content now also yields the "Invalid XML
file." notification instead of an XMLSyntaxError.