mirror of
https://github.com/bringout/oca-technical.git
synced 2026-04-18 23:12:01 +02:00
Initial commit: OCA Technical packages (595 packages)
This commit is contained in:
commit
2cc02aac6e
24950 changed files with 2318079 additions and 0 deletions
|
|
@ -0,0 +1,38 @@
|
|||
# Copyright (C) 2010 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo.tests import common
|
||||
|
||||
|
||||
class TestModelAudit(common.TransactionCase):
|
||||
def test_get_action_url(self):
|
||||
"""Test if action url start with http."""
|
||||
|
||||
record = self.env.ref("mgmtsystem_audit.mgmtsystem_audit_demo")
|
||||
|
||||
ret = record.get_action_url()
|
||||
|
||||
self.assertEqual(isinstance(ret, str), True)
|
||||
self.assertEqual(ret.startswith("http"), True)
|
||||
|
||||
def test_button_close(self):
|
||||
"""Test if button close change audit state to close."""
|
||||
record = self.env.ref("mgmtsystem_audit.mgmtsystem_audit_demo")
|
||||
record.state = "open"
|
||||
self.assertEqual(record.state, "open")
|
||||
record.button_close()
|
||||
self.assertEqual(record.state, "done")
|
||||
|
||||
def test_get_lines_by_procedure(self):
|
||||
line_id = self.env["mgmtsystem.verification.line"].create(
|
||||
{
|
||||
"name": "test",
|
||||
"procedure_id": self.env.ref("document_page.demo_page1").id,
|
||||
}
|
||||
)
|
||||
line_id2 = self.env["mgmtsystem.verification.line"].create({"name": "test2"})
|
||||
|
||||
record = self.env.ref("mgmtsystem_audit.mgmtsystem_audit_demo")
|
||||
record.line_ids = [line_id.id, line_id2.id]
|
||||
q = record.get_lines_by_procedure()
|
||||
self.assertTrue(q)
|
||||
Loading…
Add table
Add a link
Reference in a new issue