本文整理汇总了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)
示例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()
示例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)
示例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()
示例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)
示例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()
示例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)
示例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()
示例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()
示例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()
示例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)
示例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)
示例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)
示例14: test
def test(): # pragma nocover
creator = api.prepare_test()
retval = run_dialog(PurchaseWizard, None, creator.store)
creator.store.confirm(retval)
示例15: test
def test(): # pragma: no cover
ec = api.prepare_test()
person = run_dialog(BranchDialog, None, ec.store)
print('RETVAL', person)