Reviewers: ,
Please review this at http://codereview.tryton.org/165007/ Affected files: M tests/test_product.py M uom.py Index: tests/test_product.py =================================================================== --- a/tests/test_product.py +++ b/tests/test_product.py @@ -54,7 +54,7 @@ }) transaction.cursor.rollback() - uom_id = self.uom.create({ + self.uom.create({ 'name': 'Test', 'symbol': 'T', 'category': category_id, @@ -123,7 +123,7 @@ ('centimeter', 'rate'), ('Foot', 'factor'), ] - with Transaction().start(DB_NAME, USER, CONTEXT) as transaction: + with Transaction().start(DB_NAME, USER, CONTEXT): for name, result in tests: uom_id = self.uom.search([ ('name', '=', name), @@ -143,7 +143,7 @@ ('Second', 25, 'Hour', 0.0069444444444444441, 0.01), ('Millimeter', 3, 'Inch', 0.11811023622047245, 0.12), ] - with Transaction().start(DB_NAME, USER, CONTEXT) as transaction: + with Transaction().start(DB_NAME, USER, CONTEXT): for from_name, qty, to_name, result, rounded_result in tests: from_uom = self.uom.browse(self.uom.search( [ @@ -176,7 +176,7 @@ ('Second', Decimal('25'), 'Hour', Decimal('90000')), ('Millimeter', Decimal('3'), 'Inch', Decimal('76.2')), ] - with Transaction().start(DB_NAME, USER, CONTEXT) as transaction: + with Transaction().start(DB_NAME, USER, CONTEXT): for from_name, price, to_name, result in tests: from_uom = self.uom.browse(self.uom.search( [ Index: uom.py =================================================================== --- a/uom.py +++ b/uom.py @@ -95,7 +95,6 @@ return 2 def default_category(self): - category_obj = Pool().get('product.uom.category') product_obj = Pool().get('product.product') context = Transaction().context if 'category' in context: -- [email protected] mailing list
