当前位置: 首页>>代码示例>>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;未经允许,请勿转载。