Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IMP] bank_statement_check_number: add tests #581

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions bank_statement_check_number/tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import test_check_number
37 changes: 37 additions & 0 deletions bank_statement_check_number/tests/test_check_number.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
from odoo.tests import Form, tagged
from odoo.tests.common import TransactionCase


@tagged("post_install", "-at_install")
class TestCheckNumber(TransactionCase):
def setUp(self):
super().setUp()
self.journal = self.env["account.journal"].create(
{
"name": "Bank2",
"code": "BNK2",
"active": True,
"type": "bank",
}
)
self.partner = self.env["res.partner"].create({"name": "TestPartner"})

self.date = "2023-08-29"

def test_01_check_number(self):
with Form(self.env["account.bank.statement"]) as bank_statement_form:
bank_statement_form.name = "BankStatementTest"
bank_statement_form.journal_id = self.journal
bank_statement_form.date = self.date
bank_statement_form.balance_start = 1000
bank_statement_form.balance_end_real = 1000
with bank_statement_form.line_ids.new() as statement_line:
statement_line.date = self.date
statement_line.check_number = "111"
statement_line.partner_id = self.partner
statement_line.amount = 1000
statement_line.payment_ref = "S001"
statement = bank_statement_form.save()
statement.button_post()

self.assertEqual(statement.line_ids.check_number, "111")
Loading