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


Python Factory.rand_currency方法代码示例

本文整理汇总了Python中test_factory.Factory.rand_currency方法的典型用法代码示例。如果您正苦于以下问题:Python Factory.rand_currency方法的具体用法?Python Factory.rand_currency怎么用?Python Factory.rand_currency使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在test_factory.Factory的用法示例。


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

示例1: add_a_donation

# 需要导入模块: from test_factory import Factory [as 别名]
# 或者: from test_factory.Factory import rand_currency [as 别名]
    def add_a_donation(self, amount=None, date=None, type=None, notes=None, in_honor=False, in_memory=False, honorarium_name=None):
        sel = self.selenium
        self.switch_to_donor_tab()
        if not amount:
            amount = "%.2f" % (Factory.rand_currency())
        if not date:
            d = Factory.rand_date()
            date = "%02d/%02d/%02d" % (d.month, d.day, d.year)
        sel.click("css=tabbed_box[name=add_a_donation] tab_title")
        sel.type("css=#id_amount", amount)
        sel.type("css=#id_date", date)
        if type:
            sel.select("css=#id_type",type)
        if notes:
            sel.type("css=#id_notes", notes)

        if in_honor:
            sel.click("css=#id_in_honor_of")
        
        if in_memory:
            sel.click("css=#id_in_memory_of")
        
        if honorarium_name:
            sel.type("css=#id_honorarium_name", honorarium_name)

        sel.click("css=tabbed_box[name=add_a_donation] .add_donation_btn")
        time.sleep(2)
        return amount,date
开发者ID:skoczen,项目名称:mycelium,代码行数:30,代码来源:selenium_abstractions.py


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