本文整理匯總了Python中stoqlib.domain.person.Client.update_credit_limit方法的典型用法代碼示例。如果您正苦於以下問題:Python Client.update_credit_limit方法的具體用法?Python Client.update_credit_limit怎麽用?Python Client.update_credit_limit使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類stoqlib.domain.person.Client
的用法示例。
在下文中一共展示了Client.update_credit_limit方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: _credit_limit_salary_changed
# 需要導入模塊: from stoqlib.domain.person import Client [as 別名]
# 或者: from stoqlib.domain.person.Client import update_credit_limit [as 別名]
def _credit_limit_salary_changed(new_value, store):
from stoqlib.domain.person import Client
old_value = sysparam(store).CREDIT_LIMIT_SALARY_PERCENT
if new_value == old_value:
return
new_value = Decimal(new_value)
Client.update_credit_limit(new_value, store)
示例2: test_update_credit_limit
# 需要導入模塊: from stoqlib.domain.person import Client [as 別名]
# 或者: from stoqlib.domain.person.Client import update_credit_limit [as 別名]
def test_update_credit_limit(self):
client = self.create_client()
client.salary = 100
# just setting paramater to a value that won't interfere in
# the tests
sysparam(self.store).update_parameter(
u"CREDIT_LIMIT_SALARY_PERCENT",
u"5")
# testing if updates
Client.update_credit_limit(10, self.store)
client.credit_limit = AutoReload
self.assertEquals(client.credit_limit, 10)
# testing if it does not update
client.credit_limit = 200
Client.update_credit_limit(0, self.store)
self.assertEquals(client.credit_limit, 200)