From 12ce03ded768de21c435645c8f6ebee8b0e94cd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Fri, 26 Jun 2009 18:21:13 +0200 Subject: [PATCH] Add test views Remove deprecated test by MPTT --- tests/test_stock.py | 25 ++++--------------------- 1 file changed, 4 insertions(+), 21 deletions(-) diff --git a/tests/test_stock.py b/tests/test_stock.py index 5c3ac50b5f..25166ae638 100644 --- a/tests/test_stock.py +++ b/tests/test_stock.py @@ -10,7 +10,7 @@ if os.path.isdir(DIR): import unittest import trytond.tests.test_tryton -from trytond.tests.test_tryton import RPCProxy, CONTEXT, SOCK +from trytond.tests.test_tryton import RPCProxy, CONTEXT, SOCK, test_view class StockTestCase(unittest.TestCase): ''' @@ -21,28 +21,11 @@ class StockTestCase(unittest.TestCase): trytond.tests.test_tryton.install_module('stock') self.location = RPCProxy('stock.location') - def test0990location(self): + def test0005views(self): ''' - Create locations. + Test views. ''' - storage_id = self.location.search([ - ('code', '=', 'STO'), - ], CONTEXT)[0] - - new_locations = [storage_id] - - for j in range(5): - parent_locations = new_locations - new_locations = [] - for parent_location in parent_locations: - for i in range(4): - location_id = self.location.create({ - 'name': 'Test ' + str(j) + ' ' + str(i), - 'parent': parent_location, - 'type': 'storage', - }, CONTEXT) - new_locations.append(location_id) - + self.assertRaises(Exception, test_view('stock')) def suite(): return unittest.TestLoader().loadTestsFromTestCase(StockTestCase)