當前位置: 首頁>>代碼示例>>Python>>正文


Python Factory.people_mailing_list_spreadsheet_file方法代碼示例

本文整理匯總了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)
開發者ID:skoczen,項目名稱:mycelium,代碼行數:13,代碼來源:unit_tests.py

示例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
開發者ID:skoczen,項目名稱:mycelium,代碼行數:10,代碼來源:abstractions.py

示例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
開發者ID:skoczen,項目名稱:mycelium,代碼行數:22,代碼來源:unit_tests.py


注:本文中的test_factory.Factory.people_mailing_list_spreadsheet_file方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。