Exemplo n.º 1
0
 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')
Exemplo n.º 2
0
    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])
Exemplo n.º 3
0
    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')
Exemplo n.º 4
0
    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')
Exemplo n.º 5
0
 def test_create(self):
     editor = ProductionProductEditor(self.store)
     editor.code.update("12345")
     self.check_editor(editor, 'editor-product-prod-create')
Exemplo n.º 6
0
 def testShow(self):
     product = self.create_product()
     editor = ProductionProductEditor(self.store, product)
     editor.code.update("12345")
     self.check_editor(editor, 'editor-productionproduct-show')