当前位置: 首页>>代码示例>>Python>>正文


Python api.prepare_test函数代码示例

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


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


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