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
|
@ -3,26 +3,9 @@
|
||||||
tests/__init__.py
|
tests/__init__.py
|
||||||
|
|
||||||
:copyright: (c) 2014 by Openlabs Technologies & Consulting (P) Limited
|
: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.
|
:license: BSD, see LICENSE for more details.
|
||||||
"""
|
"""
|
||||||
import unittest
|
from .test_party_merge import suite
|
||||||
|
|
||||||
import trytond.tests.test_tryton
|
__all__ = ['suite']
|
||||||
|
|
||||||
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())
|
|
||||||
|
|
|
@ -3,45 +3,26 @@
|
||||||
tests/test_party.py
|
tests/test_party.py
|
||||||
|
|
||||||
:copyright: (C) 2014 by Openlabs Technologies & Consulting (P) Limited
|
: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.
|
:license: BSD, see LICENSE for more details.
|
||||||
"""
|
"""
|
||||||
import sys
|
from trytond.tests.test_tryton import ModuleTestCase
|
||||||
import os
|
from trytond.tests.test_tryton import POOL, DB_NAME, USER, CONTEXT
|
||||||
DIR = os.path.abspath(os.path.normpath(os.path.join(
|
import trytond.tests.test_tryton
|
||||||
__file__, '..', '..', '..', '..', '..', 'trytond'
|
from trytond.transaction import Transaction
|
||||||
)))
|
|
||||||
if os.path.isdir(DIR):
|
|
||||||
sys.path.insert(0, os.path.dirname(DIR))
|
|
||||||
import unittest
|
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
|
class PartyMergeTestCase(ModuleTestCase):
|
||||||
from trytond.tests.test_tryton import DB_NAME, CONTEXT
|
'Test Party'
|
||||||
from trytond.transaction import Transaction
|
module = 'party_merge'
|
||||||
import trytond.tests.test_tryton
|
|
||||||
|
|
||||||
|
|
||||||
class TestParty(unittest.TestCase):
|
|
||||||
'''
|
|
||||||
Test Party
|
|
||||||
'''
|
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
"""
|
super(PartyMergeTestCase, self).setUp()
|
||||||
Set up data used in the tests.
|
|
||||||
this method is called before each test function execution.
|
|
||||||
"""
|
|
||||||
trytond.tests.test_tryton.install_module('party_merge')
|
|
||||||
|
|
||||||
self.Party = POOL.get('party.party')
|
self.Party = POOL.get('party.party')
|
||||||
|
|
||||||
def test0005_merge_parties(self):
|
def test0005_merge_parties(self):
|
||||||
"""Test party merge function.
|
'Test party merge function'
|
||||||
"""
|
|
||||||
with Transaction().start(DB_NAME, USER, context=CONTEXT):
|
with Transaction().start(DB_NAME, USER, context=CONTEXT):
|
||||||
party1, party2, party3 = self.Party.create([{
|
party1, party2, party3 = self.Party.create([{
|
||||||
'name': 'Party 1',
|
'name': 'Party 1',
|
||||||
|
@ -74,14 +55,7 @@ class TestParty(unittest.TestCase):
|
||||||
|
|
||||||
|
|
||||||
def suite():
|
def suite():
|
||||||
"""
|
suite = trytond.tests.test_tryton.suite()
|
||||||
Define suite
|
suite.addTests(unittest.TestLoader().loadTestsFromTestCase(
|
||||||
"""
|
PartyMergeTestCase))
|
||||||
test_suite = trytond.tests.test_tryton.suite()
|
return suite
|
||||||
test_suite.addTests(
|
|
||||||
unittest.TestLoader().loadTestsFromTestCase(TestParty)
|
|
||||||
)
|
|
||||||
return test_suite
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
unittest.TextTestRunner(verbosity=2).run(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]
|
[tryton]
|
||||||
version=3.2.1.0
|
version=3.8.0
|
||||||
depends:
|
depends:
|
||||||
party
|
party
|
||||||
xml:
|
xml:
|
||||||
|
|
Loading…
Reference in a new issue