From 3aebaa6f437f6780cad0a8e05817e50d7ce8dbf3 Mon Sep 17 00:00:00 2001 From: Jos De Graeve Date: Thu, 4 Jun 2015 17:34:13 +0200 Subject: [PATCH] PEP8 fixes --- pos_require_customer/tests/__init__.py | 2 +- pos_require_customer/tests/test_pos.py | 18 ++++++++---------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/pos_require_customer/tests/__init__.py b/pos_require_customer/tests/__init__.py index ff3270cd..abf4b32c 100644 --- a/pos_require_customer/tests/__init__.py +++ b/pos_require_customer/tests/__init__.py @@ -1 +1 @@ -from . import test_pos \ No newline at end of file +from . import test_pos diff --git a/pos_require_customer/tests/test_pos.py b/pos_require_customer/tests/test_pos.py index f627297e..bb544a25 100644 --- a/pos_require_customer/tests/test_pos.py +++ b/pos_require_customer/tests/test_pos.py @@ -5,18 +5,17 @@ from openerp import exceptions class TestPosRequireCustomer(common.TransactionCase): - def setUp(self): super(TestPosRequireCustomer, self).setUp() def test_customer_not_required(self): - posconfig = self.env.ref('point_of_sale.pos_config_main') posconfig.require_customer = False - pos_session = self.env['pos.session'].create({'config_id': - posconfig.id}) - + # Now Create new session and create a + # pos order in this session + pos_session = self.env['pos.session'].create( + {'config_id': posconfig.id}) # should not raise any exception self.env['pos.order'].create({ 'session_id': pos_session.id, @@ -24,13 +23,13 @@ class TestPosRequireCustomer(common.TransactionCase): }) def test_customer_is_required(self): - posconfig = self.env.ref('point_of_sale.pos_config_main') posconfig.require_customer = True - pos_session = self.env['pos.session'].create({'config_id': - posconfig.id}) - + # Now Create new session and create a + # pos order in this session + pos_session = self.env['pos.session'].create( + {'config_id': posconfig.id}) # should raise exceptions.ValidationError self.assertRaises( exceptions.ValidationError, @@ -39,4 +38,3 @@ class TestPosRequireCustomer(common.TransactionCase): 'partner_id': False, }) ) -