Cleanup tests
review2491002
This commit is contained in:
1 parent
4bc0f7e116
commit
3ecdb19bb1
1 file changed
+8
-35
+8
-35
@@ -1,13 +1,5 @@
|
||||
#!/usr/bin/env python
|
||||
#This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
#this repository contains the full copyright notices and license terms.
|
||||
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 POOL, DB_NAME, USER, CONTEXT, test_view,\
|
||||
@@ -16,9 +8,7 @@ from trytond.transaction import Transaction
|
||||
|
||||
|
||||
class PartyTestCase(unittest.TestCase):
|
||||
'''
|
||||
Test Party module.
|
||||
'''
|
||||
'Test Party module'
|
||||
|
||||
def setUp(self):
|
||||
trytond.tests.test_tryton.install_module('party')
|
||||
@@ -27,21 +17,15 @@ class PartyTestCase(unittest.TestCase):
|
||||
self.address = POOL.get('party.address')
|
||||
|
||||
def test0005views(self):
|
||||
'''
|
||||
Test views.
|
||||
'''
|
||||
'Test views'
|
||||
test_view('party')
|
||||
|
||||
def test0006depends(self):
|
||||
'''
|
||||
Test depends.
|
||||
'''
|
||||
'Test depends'
|
||||
test_depends()
|
||||
|
||||
def test0010category(self):
|
||||
'''
|
||||
Create category.
|
||||
'''
|
||||
'Create category'
|
||||
with Transaction().start(DB_NAME, USER,
|
||||
context=CONTEXT) as transaction:
|
||||
category1, = self.category.create([{
|
||||
@@ -51,9 +35,7 @@ class PartyTestCase(unittest.TestCase):
|
||||
transaction.cursor.commit()
|
||||
|
||||
def test0020category_recursion(self):
|
||||
'''
|
||||
Test category recursion.
|
||||
'''
|
||||
'Test category recursion'
|
||||
with Transaction().start(DB_NAME, USER, context=CONTEXT):
|
||||
category1, = self.category.search([
|
||||
('name', '=', 'Category 1'),
|
||||
@@ -71,9 +53,7 @@ class PartyTestCase(unittest.TestCase):
|
||||
})
|
||||
|
||||
def test0030party(self):
|
||||
'''
|
||||
Create party.
|
||||
'''
|
||||
'Create party'
|
||||
with Transaction().start(DB_NAME, USER,
|
||||
context=CONTEXT) as transaction:
|
||||
party1, = self.party.create([{
|
||||
@@ -83,9 +63,7 @@ class PartyTestCase(unittest.TestCase):
|
||||
transaction.cursor.commit()
|
||||
|
||||
def test0040party_code(self):
|
||||
'''
|
||||
Test party code constraint.
|
||||
'''
|
||||
'Test party code constraint'
|
||||
with Transaction().start(DB_NAME, USER, context=CONTEXT):
|
||||
party1, = self.party.search([], limit=1)
|
||||
|
||||
@@ -101,9 +79,7 @@ class PartyTestCase(unittest.TestCase):
|
||||
})
|
||||
|
||||
def test0050address(self):
|
||||
'''
|
||||
Create address.
|
||||
'''
|
||||
'Create address'
|
||||
with Transaction().start(DB_NAME, USER, context=CONTEXT):
|
||||
party1, = self.party.search([], limit=1)
|
||||
|
||||
@@ -119,6 +95,3 @@ def suite():
|
||||
suite = trytond.tests.test_tryton.suite()
|
||||
suite.addTests(unittest.TestLoader().loadTestsFromTestCase(PartyTestCase))
|
||||
return suite
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.TextTestRunner(verbosity=2).run(suite())
|
||||
Reference in new issue
Block a user