def testShow(self): component = self.create_product_component() component.component.sellable.code = u'4567' editor = ProductionProductEditor( self.store, component.product) editor.code.update("12345") self.check_editor(editor, 'editor-product-prod-show')
def test_confirm(self): component = self.create_product_component(storable=True) component.component.sellable.code = u'4567' component.product.sellable.code = u'6789' editor = ProductionProductEditor(self.store, component.product) self.click(editor.main_dialog.ok_button) self.check_editor(editor, 'editor-product-prod-confirm', [editor.retval])
def testEditComponentEditComposed(self, info): component = self.create_product_component() component.component.sellable.code = u'4567' branch = get_current_branch(self.store) self.create_storable(component.component, branch=branch, stock=1, unit_cost=10) editor = ProductionProductEditor(self.store, component.component) editor.code.update("12345") compslave = editor.component_slave compslave.component_combo.select_item_by_data(component.product) self.click(compslave.add_button) info.assert_called_once_with( 'You can not add this product as component, ' 'since Description is composed by Description')
def testEditComponent(self, run_dialog): run_dialog.return_value = None component = self.create_product_component() component.component.sellable.code = u'4567' branch = get_current_branch(self.store) self.create_storable(component.product, branch=branch, stock=1, unit_cost=10) editor = ProductionProductEditor(self.store, component.product) editor.code.update("12345") compslave = editor.component_slave compslave.component_combo.select_item_by_data(component.component) self.click(compslave.add_button) self.assertEquals(run_dialog.call_count, 1) self.check_editor(editor, 'editor-product-prod-edit')
def test_create(self): editor = ProductionProductEditor(self.store) editor.code.update("12345") self.check_editor(editor, 'editor-product-prod-create')
def testShow(self): product = self.create_product() editor = ProductionProductEditor(self.store, product) editor.code.update("12345") self.check_editor(editor, 'editor-productionproduct-show')