本文整理汇总了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)