Remove __main__ entry point and PATH manipulation in test
This commit is contained in:
parent
e1a042080e
commit
6ce5686bbd
|
@ -1,21 +1,13 @@
|
|||
#!/usr/bin/env python
|
||||
# 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 datetime
|
||||
import unittest
|
||||
from decimal import Decimal
|
||||
from dateutil.relativedelta import relativedelta
|
||||
import trytond.tests.test_tryton
|
||||
from trytond.tests.test_tryton import POOL, DB_NAME, USER, CONTEXT, test_view,\
|
||||
test_depends
|
||||
from trytond.tests.test_tryton import (POOL, DB_NAME, USER, CONTEXT, test_view,
|
||||
test_depends)
|
||||
from trytond.exceptions import UserError
|
||||
from trytond.transaction import Transaction
|
||||
|
||||
|
@ -101,7 +93,8 @@ class TestCase(unittest.TestCase):
|
|||
'''
|
||||
with Transaction().start(DB_NAME, USER, context=CONTEXT):
|
||||
company, = self.company.search([
|
||||
('party.name', '=', 'Dunder Mifflin')])
|
||||
('party.name', '=', 'Dunder Mifflin'),
|
||||
])
|
||||
currency = company.currency
|
||||
self.user.write([self.user(USER)], {
|
||||
'main_company': company.id,
|
||||
|
@ -218,6 +211,3 @@ def suite():
|
|||
suite.addTest(test)
|
||||
suite.addTests(unittest.TestLoader().loadTestsFromTestCase(TestCase))
|
||||
return suite
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.TextTestRunner(verbosity=2).run(suite())
|
||||
|
|
Loading…
Reference in New Issue