test_import.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:offenewahlen-nrw17 作者: OKFNat 项目源码 文件源码
def test_import_json_result_data_with_mapping(self):
        """
        Tests an json import of results.
        """

        number_of_results = RawData.objects.count()
        self.assertEqual(number_of_results, 1)

        number_of_results = PollingStationResult.objects.count()
        self.assertEqual(number_of_results, 4)

        # call_command('import_results', local_data_file, location='local',
        #   file_type='json', mapping_file=mapping_file)
        # number_of_results = RawData.objects.count()
        # self.assertEqual(number_of_results, 2)

    #def test_import_base_data(self):
    #
    #   number_of_results = RawData.objects.count()
    #   self.assertEqual()

    # def test_import_xml_result_data_with_mapping(self):
    #   """
    #   Tests an xml import.
    #   """
    #   test_path = os.path.dirname(os.path.realpath(__file__))
    #   local_data_file = test_path + '/data/example_01.xml'
    #   mapping_file = test_path + '/data/example_mapping.json'

    #   call_command('import_results', local_data_file, location='local',
    #       file_type='xml', mapping_file=mapping_file)
    #   number_of_results = RawData.objects.count()
    #   self.assertEqual(number_of_results, 1)

    #   call_command('import_results', local_data_file, location='local',
    #       file_type='xml', mapping_file=mapping_file)
    #   number_of_results = RawData.objects.count()
    #   self.assertEqual(number_of_results, 2)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号