-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #36 from ursais/12.0-fix-backend_id
[FIX] connector_equipment: Mislabeled Variable
- Loading branch information
Showing
3 changed files
with
48 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
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,3 @@ | ||
# Copyright (C) 2019 - TODAY, Open Source Integrators | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
from . import test_connector_equipment |
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,43 @@ | ||
# Copyright (C) 2019 - TODAY, Open Source Integrators | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
import time | ||
from odoo.tests.common import TransactionCase | ||
|
||
|
||
class ConnectorEquipment(TransactionCase): | ||
|
||
def setUp(self): | ||
super(ConnectorEquipment, self).setUp() | ||
self.backend_equipment = self.env['backend.equipment'] | ||
self.maintenance_equipment = self.env['maintenance.equipment'] | ||
|
||
def test_maintenance_equipment_create(self): | ||
""" Test creating new workorders, and test following functions, | ||
- _compute_duration() in hrs | ||
- _compute_request_late() | ||
- Set scheduled_date_start using request_early w/o time | ||
- scheduled_date_end = scheduled_date_start + duration (hrs) | ||
""" | ||
|
||
backend_01 = self.env['backend.equipment'].create({ | ||
'name': 'Test Equipment', | ||
'host': 'Test Host', | ||
'port': 'Test Port', | ||
'user': 'Test User', | ||
'password': 'Test Password', | ||
'protocol': 'rest' | ||
}) | ||
equipment_01 = self.env['maintenance.equipment'].create({ | ||
'name': 'Samsung Monitor "15', | ||
'category_id': self.ref('maintenance.equipment_monitor'), | ||
'technician_user_id': self.ref('base.user_root'), | ||
'assign_date': time.strftime('%Y-%m-%d'), | ||
'serial_no': 'MT/127/18291015', | ||
'model': 'NP355E5X', | ||
'color': 3, | ||
'backend_id': backend_01.id, | ||
'managed': True | ||
|
||
}) | ||
|
||
self.assertEqual(equipment_01.update_config(), True) |