mirror of
https://github.com/NaN-tic/trytond-party_merge.git
synced 2023-12-14 03:13:02 +01:00
Migrate to version 3.8
This commit is contained in:
parent
a7dfa16cdd
commit
9b6ac69760
4 changed files with 18 additions and 118 deletions
|
@ -3,26 +3,9 @@
|
|||
tests/__init__.py
|
||||
|
||||
:copyright: (c) 2014 by Openlabs Technologies & Consulting (P) Limited
|
||||
:copyright: (C) 2016 by NaN·tic Projectes de programari lliure
|
||||
:license: BSD, see LICENSE for more details.
|
||||
"""
|
||||
import unittest
|
||||
from .test_party_merge import suite
|
||||
|
||||
import trytond.tests.test_tryton
|
||||
|
||||
from tests.test_views_depends import TestViewsDepends
|
||||
from tests.test_party import TestParty
|
||||
|
||||
|
||||
def suite():
|
||||
"""
|
||||
Define suite
|
||||
"""
|
||||
test_suite = trytond.tests.test_tryton.suite()
|
||||
test_suite.addTests([
|
||||
unittest.TestLoader().loadTestsFromTestCase(TestViewsDepends),
|
||||
unittest.TestLoader().loadTestsFromTestCase(TestParty),
|
||||
])
|
||||
return test_suite
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.TextTestRunner(verbosity=2).run(suite())
|
||||
__all__ = ['suite']
|
||||
|
|
|
@ -3,45 +3,26 @@
|
|||
tests/test_party.py
|
||||
|
||||
:copyright: (C) 2014 by Openlabs Technologies & Consulting (P) Limited
|
||||
:copyright: (C) 2016 by NaN·tic Projectes de programari lliure
|
||||
:license: BSD, see LICENSE for more details.
|
||||
"""
|
||||
import sys
|
||||
import os
|
||||
DIR = os.path.abspath(os.path.normpath(os.path.join(
|
||||
__file__, '..', '..', '..', '..', '..', 'trytond'
|
||||
)))
|
||||
if os.path.isdir(DIR):
|
||||
sys.path.insert(0, os.path.dirname(DIR))
|
||||
from trytond.tests.test_tryton import ModuleTestCase
|
||||
from trytond.tests.test_tryton import POOL, DB_NAME, USER, CONTEXT
|
||||
import trytond.tests.test_tryton
|
||||
from trytond.transaction import Transaction
|
||||
import unittest
|
||||
|
||||
if 'DB_NAME' not in os.environ:
|
||||
from trytond.config import CONFIG
|
||||
CONFIG['db_type'] = 'sqlite'
|
||||
os.environ['DB_NAME'] = ':memory:'
|
||||
|
||||
from trytond.tests.test_tryton import POOL, USER
|
||||
from trytond.tests.test_tryton import DB_NAME, CONTEXT
|
||||
from trytond.transaction import Transaction
|
||||
import trytond.tests.test_tryton
|
||||
|
||||
|
||||
class TestParty(unittest.TestCase):
|
||||
'''
|
||||
Test Party
|
||||
'''
|
||||
class PartyMergeTestCase(ModuleTestCase):
|
||||
'Test Party'
|
||||
module = 'party_merge'
|
||||
|
||||
def setUp(self):
|
||||
"""
|
||||
Set up data used in the tests.
|
||||
this method is called before each test function execution.
|
||||
"""
|
||||
trytond.tests.test_tryton.install_module('party_merge')
|
||||
|
||||
super(PartyMergeTestCase, self).setUp()
|
||||
self.Party = POOL.get('party.party')
|
||||
|
||||
def test0005_merge_parties(self):
|
||||
"""Test party merge function.
|
||||
"""
|
||||
'Test party merge function'
|
||||
with Transaction().start(DB_NAME, USER, context=CONTEXT):
|
||||
party1, party2, party3 = self.Party.create([{
|
||||
'name': 'Party 1',
|
||||
|
@ -74,14 +55,7 @@ class TestParty(unittest.TestCase):
|
|||
|
||||
|
||||
def suite():
|
||||
"""
|
||||
Define suite
|
||||
"""
|
||||
test_suite = trytond.tests.test_tryton.suite()
|
||||
test_suite.addTests(
|
||||
unittest.TestLoader().loadTestsFromTestCase(TestParty)
|
||||
)
|
||||
return test_suite
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.TextTestRunner(verbosity=2).run(suite())
|
||||
suite = trytond.tests.test_tryton.suite()
|
||||
suite.addTests(unittest.TestLoader().loadTestsFromTestCase(
|
||||
PartyMergeTestCase))
|
||||
return suite
|
|
@ -1,57 +0,0 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
tests/test_views_depends.py
|
||||
|
||||
:copyright: (C) 2014 by Openlabs Technologies & Consulting (P) Limited
|
||||
:license: BSD, see LICENSE for more details.
|
||||
"""
|
||||
import sys
|
||||
import os
|
||||
DIR = os.path.abspath(os.path.normpath(os.path.join(
|
||||
__file__, '..', '..', '..', '..', '..', 'trytond'
|
||||
)))
|
||||
if os.path.isdir(DIR):
|
||||
sys.path.insert(0, os.path.dirname(DIR))
|
||||
import unittest
|
||||
|
||||
import trytond.tests.test_tryton
|
||||
from trytond.tests.test_tryton import test_view, test_depends
|
||||
|
||||
|
||||
class TestViewsDepends(unittest.TestCase):
|
||||
'''
|
||||
Test views and depends
|
||||
'''
|
||||
|
||||
def setUp(self):
|
||||
"""
|
||||
Set up data used in the tests.
|
||||
this method is called before each test function execution.
|
||||
"""
|
||||
trytond.tests.test_tryton.install_module('party_merge')
|
||||
|
||||
def test0005views(self):
|
||||
'''
|
||||
Test views.
|
||||
'''
|
||||
test_view('party_merge')
|
||||
|
||||
def test0006depends(self):
|
||||
'''
|
||||
Test depends.
|
||||
'''
|
||||
test_depends()
|
||||
|
||||
|
||||
def suite():
|
||||
"""
|
||||
Define suite
|
||||
"""
|
||||
test_suite = trytond.tests.test_tryton.suite()
|
||||
test_suite.addTests(
|
||||
unittest.TestLoader().loadTestsFromTestCase(TestViewsDepends)
|
||||
)
|
||||
return test_suite
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.TextTestRunner(verbosity=2).run(suite())
|
|
@ -1,5 +1,5 @@
|
|||
[tryton]
|
||||
version=3.2.1.0
|
||||
version=3.8.0
|
||||
depends:
|
||||
party
|
||||
xml:
|
||||
|
|
Loading…
Reference in a new issue