Exemplo n.º 1
0
    def test_description_valitation(self):
        self.create_sale_token(code=u'sale token 1')
        editor = SaleTokenEditor(self.store)
        editor.code.set_text(u'sale token 1')
        # We should not be able to register this token, description should be
        # unique
        self.assertNotSensitive(editor.main_dialog, ['ok_button'])

        editor.code.set_text(u'sale token 2')
        self.assertSensitive(editor.main_dialog, ['ok_button'])
Exemplo n.º 2
0
 def test_edit(self):
     token = self.create_sale_token(code=u'sale token 1')
     editor = SaleTokenEditor(self.store, model=token)
     self.check_editor(editor, 'editor-saletoken-edit')
Exemplo n.º 3
0
 def test_create(self):
     editor = SaleTokenEditor(self.store)
     self.check_editor(editor, 'editor-saletoken-create')