本文整理汇总了Python中test_factory.Factory.people_mailing_list_spreadsheet_file方法的典型用法代码示例。如果您正苦于以下问题:Python Factory.people_mailing_list_spreadsheet_file方法的具体用法?Python Factory.people_mailing_list_spreadsheet_file怎么用?Python Factory.people_mailing_list_spreadsheet_file使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类test_factory.Factory
的用法示例。
在下文中一共展示了Factory.people_mailing_list_spreadsheet_file方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test__detect_type
# 需要导入模块: from test_factory import Factory [as 别名]
# 或者: from test_factory.Factory import people_mailing_list_spreadsheet_file [as 别名]
def test__detect_type(self):
fh = Factory.people_mailing_list_spreadsheet_file(self.a1, file_type=CSV_TYPE)
s = SpreadsheetAbstraction(self.a1, fh, "people", filename="test.foo")
self.assertEqual(s.type, CSV_TYPE)
self.assertEqual(s.is_valid,True)
fh = Factory.people_mailing_list_spreadsheet_file(self.a1, file_type=EXCEL_TYPE)
s = SpreadsheetAbstraction(self.a1, fh, "people", filename="test.bar")
self.assertEqual(s.type, EXCEL_TYPE)
self.assertEqual(s.is_valid,True)
示例2: created_and_imported_excel_spreadsheet
# 需要导入模块: from test_factory import Factory [as 别名]
# 或者: from test_factory.Factory import people_mailing_list_spreadsheet_file [as 别名]
def created_and_imported_excel_spreadsheet(self, **kwargs):
fh = Factory.people_mailing_list_spreadsheet_file(self.a1, file_type=EXCEL_TYPE, **kwargs)
# import it
fh.seek(0)
s = SpreadsheetAbstraction(self.a1, fh, "people", filename="test.xls")
self.assertEqual(s.is_valid,True)
return s
示例3: _create_a_person_spreadsheet_and_clear_the_data
# 需要导入模块: from test_factory import Factory [as 别名]
# 或者: from test_factory.Factory import people_mailing_list_spreadsheet_file [as 别名]
def _create_a_person_spreadsheet_and_clear_the_data(self, file_type=CSV_TYPE, extension=None,):
if not extension:
if file_type == CSV_TYPE:
extension = "csv"
elif file_type == EXCEL_TYPE:
extension = "xls"
# create a person spreadsheet
fh = Factory.people_mailing_list_spreadsheet_file(self.a1, file_type=file_type)
# delete all the people
Person.objects_by_account(self.a1).all().delete()
# assert that they're gone
self.assertEqual(Person.objects_by_account(self.a1).count(), 0)
# import the spreadsheet
s = SpreadsheetAbstraction(self.a1, fh, "people", filename="test.%s" % (extension,))
return s