Skip to content

Commit

Permalink
Replace yml test by a python unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
yvaucher committed Apr 28, 2016
1 parent f230d84 commit 6c2c8b8
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 11 deletions.
1 change: 0 additions & 1 deletion analytic_base_department/__openerp__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,5 @@
"website": "http://camptocamp.com",
"depends": ["analytic", "hr"],
"data": ["views/analytic.xml"],
'test': ['test/analytic.yml'],
'installable': True,
}
7 changes: 0 additions & 7 deletions analytic_base_department/test/analytic.yml

This file was deleted.

6 changes: 3 additions & 3 deletions analytic_base_department/tests/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-
# © 2016 Daniel Reis (Camptocamp)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import models
# © 2016 Yannick Vaucher (Camptocamp)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from . import test_line_department
16 changes: 16 additions & 0 deletions analytic_base_department/tests/test_line_department.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from openerp.tests.common import TransactionCase


class LineDepartmentCase(TransactionCase):

def test_default_department(self):
"""In a new users form, a user set only the firstname."""
aal = self.env['account.analytic.line'].sudo(self.user).new()
department_id = aal.default_get(['department_id']).get('department_id')
self.assertEqual(department_id, self.dep.id)

def setUp(self):
super(LineDepartmentCase, self).setUp()
#--> hr.employee_qdp --> hr.dep_rd
self.user = self.env.ref('base.user_demo')
self.dep = self.env.ref('hr.dep_rd')

0 comments on commit 6c2c8b8

Please sign in to comment.