formatting
This commit is contained in:
parent
2a4fbbabdd
commit
f4597378c3
5 changed files with 30 additions and 21 deletions
|
@ -1,24 +1,26 @@
|
|||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
# -*- coding: utf-8 -*-
|
||||
# This file is part of the cashbook-module from m-ds for Tryton.
|
||||
# The COPYRIGHT file at the top level of this repository contains the
|
||||
# full copyright notices and license terms.
|
||||
|
||||
import trytond.tests.test_tryton
|
||||
import unittest
|
||||
|
||||
from trytond.modules.cashbook_bookcategory.tests.test_category import CategoryTestCase
|
||||
from .test_category import CategoryTestCase
|
||||
|
||||
|
||||
__all__ = ['suite']
|
||||
|
||||
|
||||
class CashbookCategoryTestCase(\
|
||||
CategoryTestCase,\
|
||||
):
|
||||
class CashbookCategoryTestCase(CategoryTestCase):
|
||||
'Test cashbook module'
|
||||
module = 'cashbook_bookcategory'
|
||||
|
||||
# end CashbookCategoryTestCase
|
||||
|
||||
|
||||
def suite():
|
||||
suite = trytond.tests.test_tryton.suite()
|
||||
suite.addTests(unittest.TestLoader().loadTestsFromTestCase(CashbookCategoryTestCase))
|
||||
suite.addTests(unittest.TestLoader().loadTestsFromTestCase(
|
||||
CashbookCategoryTestCase))
|
||||
return suite
|
||||
|
|
|
@ -3,10 +3,9 @@
|
|||
# The COPYRIGHT file at the top level of this repository contains the
|
||||
# full copyright notices and license terms.
|
||||
|
||||
from trytond.tests.test_tryton import ModuleTestCase, with_transaction
|
||||
from trytond.tests.test_tryton import with_transaction
|
||||
from trytond.pool import Pool
|
||||
from trytond.transaction import Transaction
|
||||
from trytond.exceptions import UserError
|
||||
from trytond.modules.cashbook.tests import CashbookTestCase
|
||||
|
||||
|
||||
|
@ -22,8 +21,7 @@ class CategoryTestCase(CashbookTestCase):
|
|||
|
||||
company = self.prep_company()
|
||||
with Transaction().set_context({
|
||||
'company': company.id,
|
||||
}):
|
||||
'company': company.id}):
|
||||
categories, = BookCategory.create([{
|
||||
'name': 'Cat 0',
|
||||
'childs': [('create', [{
|
||||
|
@ -56,8 +54,7 @@ class CategoryTestCase(CashbookTestCase):
|
|||
types = self.prep_type()
|
||||
company = self.prep_company()
|
||||
with Transaction().set_context({
|
||||
'company': company.id,
|
||||
}):
|
||||
'company': company.id}):
|
||||
category, = BookCategory.create([{
|
||||
'name': 'Cat 0',
|
||||
'childs': [('create', [{
|
||||
|
@ -79,7 +76,9 @@ class CategoryTestCase(CashbookTestCase):
|
|||
self.assertEqual(book.categories[0].rec_name, 'Cat 0')
|
||||
|
||||
self.assertEqual(len(category.cashbooks), 1)
|
||||
self.assertEqual(category.cashbooks[0].rec_name, 'Book 1 | 0.00 usd | Open')
|
||||
self.assertEqual(
|
||||
category.cashbooks[0].rec_name,
|
||||
'Book 1 | 0.00 usd | Open')
|
||||
|
||||
# replace category
|
||||
Book.write(*[
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue