OLD | NEW |
(Empty) | |
| 1 #!/usr/bin/env python |
| 2 #This file is part of Tryton. The COPYRIGHT file at the top level of |
| 3 #this repository contains the full copyright notices and license terms. |
| 4 |
| 5 import sys, os |
| 6 DIR = os.path.abspath(os.path.normpath(os.path.join(__file__, |
| 7 '..', '..', '..', '..', '..', 'trytond'))) |
| 8 if os.path.isdir(DIR): |
| 9 sys.path.insert(0, os.path.dirname(DIR)) |
| 10 |
| 11 import unittest |
| 12 import doctest |
| 13 import trytond.tests.test_tryton |
| 14 from trytond.tests.test_tryton import test_view |
| 15 from trytond.backend.sqlite.database import Database as SQLiteDatabase |
| 16 |
| 17 |
| 18 class AccountStockContinentalTestCase(unittest.TestCase): |
| 19 ''' |
| 20 Test Account Stock Continental module. |
| 21 ''' |
| 22 |
| 23 def setUp(self): |
| 24 trytond.tests.test_tryton.install_module('account_stock_continental') |
| 25 |
| 26 def test0005views(self): |
| 27 ''' |
| 28 Test views. |
| 29 ''' |
| 30 test_view('account_stock_continental') |
| 31 |
| 32 def doctest_dropdb(test): |
| 33 ''' |
| 34 Remove sqlite memory database |
| 35 ''' |
| 36 database = SQLiteDatabase().connect() |
| 37 cursor = database.cursor(autocommit=True) |
| 38 try: |
| 39 database.drop(cursor, ':memory:') |
| 40 cursor.commit() |
| 41 finally: |
| 42 cursor.close() |
| 43 |
| 44 def suite(): |
| 45 suite = trytond.tests.test_tryton.suite() |
| 46 suite.addTests(unittest.TestLoader().loadTestsFromTestCase( |
| 47 AccountStockContinentalTestCase)) |
| 48 suite.addTests(doctest.DocFileSuite('scenario_account_stock_continental.rst'
, |
| 49 setUp=doctest_dropdb, tearDown=doctest_dropdb, encoding='utf-8')) |
| 50 return suite |
| 51 |
| 52 if __name__ == '__main__': |
| 53 unittest.TextTestRunner(verbosity=2).run(suite()) |
OLD | NEW |