本文整理匯總了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