Skip to content
This repository has been archived by the owner on Apr 28, 2022. It is now read-only.

Commit

Permalink
Additional tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
Richard deMeester committed May 5, 2017
1 parent 474b0ac commit 8cf09fe
Showing 1 changed file with 14 additions and 16 deletions.
30 changes: 14 additions & 16 deletions product_configurator_wizard/tests/test_wizard.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,16 +100,7 @@ def test_wizard_configuration(self):
self.assertTrue(len(created_line) == 1,
"Wizard did not create an order line")

def test_reconfiguration(self):
"""Test reconfiguration functionality of the wizard"""
self.test_wizard_configuration()

existing_lines = self.so.order_line

order_line = self.so.order_line.filtered(
lambda l: l.product_id.config_ok
)

def do_reconfigure(self, order_line):
reconfig_action = order_line.reconfigure_product()

wizard = self.env['product.configurator'].browse(
Expand All @@ -123,6 +114,18 @@ def test_reconfiguration(self):
while wizard.action_next_step():
pass

def test_reconfiguration(self):
"""Test reconfiguration functionality of the wizard"""
self.test_wizard_configuration()

existing_lines = self.so.order_line

order_line = self.so.order_line.filtered(
lambda l: l.product_id.config_ok
)

self.do_reconfigure(order_line)

config_variants = self.env['product.product'].search([
('config_ok', '=', True)
])
Expand All @@ -136,12 +139,7 @@ def test_reconfiguration(self):

# test that running through again with the same values does not
# create another variant
attr_vals = self.get_attr_values(['diesel', '220d'])
self.wizard_write_proceed(wizard, attr_vals)

# Cycle through steps until wizard ends
while wizard.action_next_step():
pass
self.do_reconfigure(order_line)

config_variants = self.env['product.product'].search([
('config_ok', '=', True)
Expand Down

0 comments on commit 8cf09fe

Please sign in to comment.