def run_regression_test_on_file(self, file): file_path = self.build_test_file_path(file) data_file = django_file_utils.create_django_file_from_local(file_path) dfu = baker.make(DataFileUpload.__name__, make_m2m=True, data_file_from_source=data_file, has_been_refined=False) dfu.refresh_from_db() self.assertIsNotNone(dfu.refined_data_file) file_data = dfu.refined_data_file.data_file.read() file_content = JsonUtils.loads(file_data.decode()) self.assert_result_equals_expected_json(file_content, file)
def build_header(self): try: return dict(JsonUtils.loads(self.header)) except Exception as e: return dict()
def read_data(self): return JsonUtils.loads(self.data_file.read())
def build_scopes_string(self): if self.scope: if isinstance(self.scope, list): return " ".join(self.scope) else: # string return " ".join(JsonUtils.loads(str(self.scope)))