Forward-port of the 18.0 tests. Add 108 tests (101 in the Community job):
- account_ebics: order numbers, camt and CFONB split per account,
journal lookup, duplicate statements, download and upload wizards,
client setup with real keys, 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.
- account_ebics_oe_statement_import_test (new, test-only, Enterprise
job only): same through the Odoo Enterprise camt import.
The bank is simulated by patching the EBICS transport; keys,
certificates and the INI letter are real, created in a temporary
directory. 19.0 differences: no account_ebics_oca_statement_import
module (its glue-specific tests are dropped), res.users.group_ids.
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.
Forward-port of the 18.0 tests. Add 108 tests (101 in the Community job):
- account_ebics: order numbers, camt and CFONB split per account,
journal lookup, duplicate statements, download and upload wizards,
client setup with real keys, 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.
- account_ebics_oe_statement_import_test (new, test-only, Enterprise
job only): same through the Odoo Enterprise camt import.
The bank is simulated by patching the EBICS transport; keys,
certificates and the INI letter are real, created in a temporary
directory. 19.0 differences: no account_ebics_oca_statement_import
module (its glue-specific tests are dropped), res.users.group_ids.
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.
_process_bank_statement_oe commits after each statement. Under tests this
leaves the test transaction (19.0 test cursors even raise on commit).
Skip the commit while a test runs, using odoo.modules.module.current_test:
Registry.in_test_mode() and the thread "testing" flag no longer exist in
19.0.
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.