• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python api.prepare_test函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中stoqlib.api.api.prepare_test函数的典型用法代码示例。如果您正苦于以下问题:Python prepare_test函数的具体用法?Python prepare_test怎么用?Python prepare_test使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了prepare_test函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: test

def test():  # pragma: no cover
    from stoqlib.gui.base.dialogs import run_dialog

    from stoqlib.api import api
    ec = api.prepare_test()
    model = ec.store.find(CostCenter).any()
    run_dialog(CostCenterDialog, None, ec.store, model)
开发者ID:romaia,项目名称:stoq,代码行数:7,代码来源:costcenterdialog.py


示例2: test_dialog

def test_dialog():  # pragma nocover
    from stoqlib.gui.base.dialogs import run_dialog

    ec = api.prepare_test()
    client = ec.store.find(Client).any()
    run_dialog(OpticalPatientDetails, None, ec.store, client)
    ec.store.commit()
开发者ID:Joaldino,项目名称:stoq,代码行数:7,代码来源:opticalhistory.py


示例3: test

def test():  # pragma nocover
    from stoqlib.api import api
    from stoqlib.gui.base.dialogs import run_dialog
    creator = api.prepare_test()
    model = creator.store.find(InvoiceLayout, description=u'Untitled').any()
    retval = run_dialog(InvoiceLayoutEditor, None, creator.store, model)
    creator.store.confirm(retval)
开发者ID:hackedbellini,项目名称:stoq,代码行数:7,代码来源:invoiceeditor.py


示例4: test

def test():  # pragma nocover
    from stoqlib.domain.workorder import WorkOrder
    from stoqlib.api import api
    creator = api.prepare_test()
    orders = creator.store.find(WorkOrder)
    r = OpticalWorkOrderReceiptReport('teste.pdf', orders)
    #r.save_html('teste.html')
    r.save()
开发者ID:igorferreira,项目名称:stoq,代码行数:8,代码来源:opticalreport.py


示例5: test_price_editor

def test_price_editor():  # pragma nocover
    from decimal import Decimal
    ec = api.prepare_test()
    sellable = ec.create_sellable()
    sellable.cost = Decimal('15.55')
    sellable.price = Decimal('21.50')
    run_dialog(SellablePriceEditor,
               parent=None, store=ec.store, model=sellable)
开发者ID:igorferreira,项目名称:stoq,代码行数:8,代码来源:sellableeditor.py


示例6: test

def test():  # pragma nocover
    from stoqlib.domain.sale import Sale
    from stoqlib.api import api
    import sys
    creator = api.prepare_test()
    sale = creator.store.find(Sale, id=int(sys.argv[-1])).one()
    r = BookletReport('teste.pdf', sale.payments)
    r.save_html('teste.html')
    r.save()
开发者ID:EasyDevSolutions,项目名称:stoq,代码行数:9,代码来源:booklet.py


示例7: test_grid_editor

def test_grid_editor():  # pragma nocover
    from stoqlib.gui.base.dialogs import run_dialog
    ec = api.prepare_test()
    group = ec.store.find(GridGroup).any()
    attribute = ec.create_grid_attribute(attribute_group=group)
    attribute.group = None
    run_dialog(GridAttributeEditor,
               parent=None, store=ec.store, model=attribute)
    print(attribute.group)
开发者ID:hackedbellini,项目名称:stoq,代码行数:9,代码来源:grideditor.py


示例8: test

def test():  # pragma no cover
    from kiwi.ui.objectlist import ObjectList
    from stoqlib.api import api
    from stoq.gui.sales import SalesApp
    from stoqlib.domain.sale import SaleView
    api.prepare_test()
    store = api.new_store()

    class Foo(SalesApp):
        def __init__(self):
            pass

    a = Foo()
    ol = ObjectList(a.get_columns())
    data = store.find(SaleView)

    r = SalesReport('teste.pdf', ol, list(data))
    r.save_html('teste.html')
    r.save()
开发者ID:relsi,项目名称:stoq,代码行数:19,代码来源:sale.py


示例9: test_editor

def test_editor(editor):  # pragma nocover
    from stoqlib.gui.base.dialogs import run_dialog
    ec = api.prepare_test()
    model = ec.store.find(editor.model_type).any()
    if not model:
        client = ec.store.find(Client).any()
        run_dialog(editor, None, ec.store, client)
    else:
        run_dialog(editor, None, ec.store, model.client, model)

    ec.store.commit()
开发者ID:Joaldino,项目名称:stoq,代码行数:11,代码来源:opticalhistory.py


示例10: dict

            due_date=self.loan.expire_date,
            value=self.loan.get_total_amount(),
            emission_city=emission_location.city,
            emission_date=datetime.date.today(),
        )

        return dict(
            subtitle=_("Loan number: %s") % order_identifier,
            loan=self.loan,
            print_promissory_note=print_promissory_note,
            promissory_data=promissory_data,
        )

    def adjust_for_test(self):
        # today is mocked on test
        date = datetime.date.today()
        self.loan.expire_date = date
        self.loan.open_date = date
        self.loan.identifier = 666
        self.logo_data = 'logo.png'


if __name__ == '__main__':  # pragma nocover
    from stoqlib.domain.loan import Loan
    import sys
    creator = api.prepare_test()
    loan_ = creator.trans.find(Loan, id=int(sys.argv[-1])).one()
    r = LoanReceipt('test.pdf', loan_)
    r.save_html('test.html')
    r.save()
开发者ID:EasyDevSolutions,项目名称:stoq,代码行数:30,代码来源:loanreceipt.py


示例11: test

def test():  # pragma nocover
    creator = api.prepare_test()
    method = PaymentMethod.get_by_name(creator.store, u'card')
    retval = run_dialog(CardPaymentMethodEditor, None, creator.store, method)
    creator.store.confirm(retval)
开发者ID:hackedbellini,项目名称:stoq,代码行数:5,代码来源:paymentmethodeditor.py


示例12: test_employee_role

def test_employee_role():  # pragma nocover
    creator = api.prepare_test()
    role = creator.create_employee_role()
    run_dialog(EmployeeRoleEditor, parent=None, store=creator.store,
               model=role)
开发者ID:Joaldino,项目名称:stoq,代码行数:5,代码来源:personeditor.py


示例13: test

def test():  # pragma nocover
    creator = api.prepare_test()
    account = creator.create_account()
    retval = run_dialog(AccountTransactionEditor, None, creator.trans,
                        None, account)
    api.creator.trans.confirm(retval)
开发者ID:leandrorchaves,项目名称:stoq,代码行数:6,代码来源:accounttransactioneditor.py


示例14: test

def test():  # pragma nocover
    creator = api.prepare_test()
    retval = run_dialog(PurchaseWizard, None, creator.store)
    creator.store.confirm(retval)
开发者ID:Guillon88,项目名称:stoq,代码行数:4,代码来源:purchasewizard.py


示例15: test

def test():  # pragma: no cover
    ec = api.prepare_test()
    person = run_dialog(BranchDialog, None, ec.store)
    print('RETVAL', person)
开发者ID:LeonamSilva,项目名称:stoq,代码行数:4,代码来源:branchdialog.py


示例16: test

def test():  # pragma: no cover
    from stoqlib.gui.base.dialogs import run_dialog
    ec = api.prepare_test()
    run_dialog(ProductSearch, None, ec.store)
开发者ID:Joaldino,项目名称:stoq,代码行数:4,代码来源:productsearch.py


示例17: test_product

def test_product():  # pragma nocover
    ec = api.prepare_test()
    product = ec.create_product()
    run_dialog(ProductEditor,
               parent=None, store=ec.store, model=product)
开发者ID:Guillon88,项目名称:stoq,代码行数:5,代码来源:producteditor.py


示例18: test

def test():  # pragma nocover
    creator = api.prepare_test()
    retval = run_dialog(InPaymentEditor, None, creator.store, None)
    creator.store.confirm(retval)
开发者ID:igorferreira,项目名称:stoq,代码行数:4,代码来源:paymenteditor.py


示例19: test

def test():  # pragma nocover
    creator = api.prepare_test()
    retval = run_dialog(AccountEditor, None, creator.store, None,
                        parent_account=None, visual_mode=True)
    creator.store.confirm(retval)
开发者ID:romaia,项目名称:stoq,代码行数:5,代码来源:accounteditor.py


示例20: test

def test():  # pragma nocover
    creator = api.prepare_test()
    sale_item = creator.create_sale_item()
    retval = run_dialog(ConfirmSaleWizard, None, creator.store,
                        sale_item.sale)
    creator.store.confirm(retval)
开发者ID:romaia,项目名称:stoq,代码行数:6,代码来源:salewizard.py



注:本文中的stoqlib.api.api.prepare_test函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python api.sysparam函数代码示例发布时间:2022-05-27
下一篇:
Python api.new_store函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap