本文整理汇总了Python中test_factory.Factory.rand_str方法的典型用法代码示例。如果您正苦于以下问题:Python Factory.rand_str方法的具体用法?Python Factory.rand_str怎么用?Python Factory.rand_str使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类test_factory.Factory
的用法示例。
在下文中一共展示了Factory.rand_str方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_that_new_donations_can_include_a_type_and_notes
# 需要导入模块: from test_factory import Factory [as 别名]
# 或者: from test_factory.Factory import rand_str [as 别名]
def test_that_new_donations_can_include_a_type_and_notes(self):
sel = self.selenium
self.create_person_and_go_to_donor_tab()
notes_str = Factory.rand_str()
a1, d1 = self.add_a_donation(amount=85.8, date="3/8/2011", type="Check", notes=notes_str)
# make sure recent donations display cleanly
self.assertEqual("$%.2f"%a1, sel.get_text("css=.donor_donation_table .donation_row:nth(0) .amount"))
self.assertEqual("March 8, 2011", sel.get_text("css=.donor_donation_table .donation_row:nth(0) .date"))
self.assertEqual("Check", sel.get_text("css=.donor_donation_table .donation_row:nth(0) .type"))
self.assertEqual("Notes: %s" % notes_str, sel.get_text("css=.donor_donation_table .donation_row:nth(0) .notes_body"))
示例2: add_a_conversation
# 需要导入模块: from test_factory import Factory [as 别名]
# 或者: from test_factory.Factory import rand_str [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