def test_save_raw_data(self):
        with patch.object(
            ImportFile, 'cache_first_rows', return_value=None
        ) as mock_method:
            tasks._save_raw_data(
                self.import_file.pk,
                'fake_cache_key',
                1
            )

        raw_saved = BuildingSnapshot.objects.filter(
            import_file=self.import_file,
        )

        raw_bldg = raw_saved[0]

        self.assertDictEqual(raw_bldg.extra_data, self.fake_extra_data)
        self.assertEqual(raw_bldg.super_organization, self.fake_org)

        expected_pk = raw_bldg.pk

        for k in self.fake_extra_data:
            self.assertEqual(
                raw_bldg.extra_data_sources.get(k),
                expected_pk,
                "%s didn't match the expected source pk.  %s vs %s" %
                (k, expected_pk, raw_bldg.extra_data_sources.get(k))
            )
Save information in extra_data, set other attrs.
dataset/ETHPy150Open buildingenergy/buildingenergy-platform/seed/tests/test_tasks.py/TestTasks.test_save_raw_data