本文整理汇总了Python中test_factory.Factory.rand_date方法的典型用法代码示例。如果您正苦于以下问题:Python Factory.rand_date方法的具体用法?Python Factory.rand_date怎么用?Python Factory.rand_date使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类test_factory.Factory
的用法示例。
在下文中一共展示了Factory.rand_date方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: add_a_donation
# 需要导入模块: from test_factory import Factory [as 别名]
# 或者: from test_factory.Factory import rand_date [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
示例2: add_a_conversation
# 需要导入模块: from test_factory import Factory [as 别名]
# 或者: from test_factory.Factory import rand_date [as 别名]
def add_a_conversation(self, body=None, date=None, type="in-person"):
sel = self.selenium
self.switch_to_conversation_tab()
if not body:
body = Factory.rand_str(500)
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_conversation] tab_title")
sel.type("css=#id_body", body)
sel.click("css=input[name=conversation_type][value=%s]" % (type,))
sel.type("css=#id_date", date)
sel.click("css=tabbed_box[name=add_a_conversation] .add_conversation_btn")
time.sleep(2)
return body,date