-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Task 004098 Issue #30 dan Unittest
- Loading branch information
Showing
7 changed files
with
55 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,6 +37,7 @@ Contributors | |
|
||
* Michael Viriyananda <[email protected]> | ||
* Andhitia Rama <[email protected]> | ||
* Nur Azmi <[email protected]> | ||
|
||
Maintainer | ||
---------- | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,5 @@ | |
from . import ( | ||
models, | ||
wizards, | ||
tests, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright 2021 OpenSynergy Indonesia | ||
# Copyright 2021 PT. Simetri Sinergi Indonesia | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
from . import ( | ||
base, | ||
test_onchange, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright 2020 OpenSynergy Indonesia | ||
# Copyright 2020 PT. Simetri Sinergi Indonesia | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
|
||
from openerp.tests.common import TransactionCase | ||
|
||
|
||
class BaseCase(TransactionCase): | ||
def setUp(self, *args, **kwargs): | ||
result = super(BaseCase, self).setUp(*args, **kwargs) | ||
self.obj_ca_settlement = self.env["hr.cash_advance_settlement"] | ||
self.advance_journal = self.env.ref("hr_cash_advance.demo_journal2") | ||
self.advance_type = self.env.ref("hr_cash_advance.demo_cash_advance_type1") | ||
|
||
self.obj_ca_settlement_line = self.env["hr.cash_advance_settlement_line"] | ||
|
||
return result |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright 2021 OpenSynergy Indonesia | ||
# Copyright 2021 PT. Simetri Sinergi Indonesia | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
|
||
|
||
from .base import BaseCase | ||
|
||
|
||
class TestOnchange(BaseCase): | ||
def test_hr_cash_advance_settlement_onchange_journal_id(self): | ||
self.advance_type.write( | ||
{ | ||
"journal_id": self.advance_journal.id, | ||
} | ||
) | ||
values = { | ||
"type_id": self.advance_type.id, | ||
} | ||
ca_settlement = self.obj_ca_settlement.new(values) | ||
ca_settlement.onchange_journal_id() | ||
|
||
self.assertEqual(ca_settlement.journal_id, self.advance_journal) |