def cross_file_errors(self):
    self.cleanup()
    (report_headers, report_content) = self.generate_cross_file_report([(CROSS_FILE_A, 'appropriations'), (CROSS_FILE_B, 'program_activity')], warning=False)
    error_count = self.session.query(ErrorMetadata).filter_by(job_id=self.val_job.job_id, severity_id=RULE_SEVERITY_DICT['fatal']).count()
    assert (error_count == 0)
    assert (report_headers == self.validator.cross_file_report_headers)
    assert (len(report_content) == 0)
    self.cleanup()
    (report_headers, report_content) = self.generate_cross_file_report([(INVALID_CROSS_A, 'appropriations'), (INVALID_CROSS_B, 'program_activity')], warning=False)
    warnings = list(self.session.query(ErrorMetadata).filter_by(job_id=self.val_job.job_id, severity_id=RULE_SEVERITY_DICT['fatal']).all())
    assert (len(warnings) == 1)
    assert (warnings[0].occurrences == 3)
    assert (report_headers == self.validator.cross_file_report_headers)
    expected_values = [{'Unique ID': 'TAS: 019-072-X-0306-000', 'Source File': 'appropriations', 'Source Field Name': 'allocationtransferagencyidentifier, agencyidentifier, beginningperiodofavailability, endingperiodofavailability, availabilitytypecode, mainaccountcode, subaccountcode', 'Target File': 'program_activity', 'Target Field Name': '', 'Rule Message': 'All TAS values in File A (appropriations) should exist in File B (object class program activity)', 'Source Value Provided': 'allocationtransferagencyidentifier: 019, agencyidentifier: 072, beginningperiodofavailability: , endingperiodofavailability: , availabilitytypecode: X, mainaccountcode: 0306, subaccountcode: 000', 'Target Value Provided': '', 'Difference': '', 'Source Flex Field': 'flex_field_a: FLEX_A, flex_field_b: FLEX_B', 'Source Row Number': '2', 'Rule Label': 'A30.1'}, {'Unique ID': 'TAS: 019-072-X-0306-000', 'Source File': 'appropriations', 'Source Field Name': 'allocationtransferagencyidentifier, agencyidentifier, beginningperiodofavailability, endingperiodofavailability, availabilitytypecode, mainaccountcode, subaccountcode', 'Target File': 'program_activity', 'Target Field Name': '', 'Rule Message': 'All TAS values in File A (appropriations) should exist in File B (object class program activity)', 'Source Value Provided': 'allocationtransferagencyidentifier: 019, agencyidentifier: 072, beginningperiodofavailability: , endingperiodofavailability: , availabilitytypecode: X, mainaccountcode: 0306, subaccountcode: 000', 'Target Value Provided': '', 'Difference': '', 'Source Flex Field': 'flex_field_a: FLEX_A, flex_field_b: FLEX_B', 'Source Row Number': '7', 'Rule Label': 'A30.1'}, {'Unique ID': 'TAS: 019-072-X-0306-000', 'Source File': 'appropriations', 'Source Field Name': 'allocationtransferagencyidentifier, agencyidentifier, beginningperiodofavailability, endingperiodofavailability, availabilitytypecode, mainaccountcode, subaccountcode', 'Target File': 'program_activity', 'Target Field Name': '', 'Rule Message': 'All TAS values in File A (appropriations) should exist in File B (object class program activity)', 'Source Value Provided': 'allocationtransferagencyidentifier: 019, agencyidentifier: 072, beginningperiodofavailability: , endingperiodofavailability: , availabilitytypecode: X, mainaccountcode: 0306, subaccountcode: 000', 'Target Value Provided': '', 'Difference': '', 'Source Flex Field': 'flex_field_a: FLEX_A, flex_field_b: FLEX_B', 'Source Row Number': '12', 'Rule Label': 'A30.1'}]
    assert (report_content == expected_values)
    self.cleanup()
def cross_file_errors(self):
    self.cleanup()
    (report_headers, report_content) = self.generate_cross_file_report([(CROSS_FILE_A, 'appropriations'), (CROSS_FILE_B, 'program_activity')], warning=False)
    error_count = self.session.query(ErrorMetadata).filter_by(job_id=self.val_job.job_id, severity_id=RULE_SEVERITY_DICT['fatal']).count()
    assert (error_count == 0)
    assert (report_headers == self.validator.cross_file_report_headers)
    assert (len(report_content) == 0)
    self.cleanup()
    (report_headers, report_content) = self.generate_cross_file_report([(INVALID_CROSS_A, 'appropriations'), (INVALID_CROSS_B, 'program_activity')], warning=False)
    warnings = list(self.session.query(ErrorMetadata).filter_by(job_id=self.val_job.job_id, severity_id=RULE_SEVERITY_DICT['fatal']).all())
    assert (len(warnings) == 1)
    assert (warnings[0].occurrences == 3)
    assert (report_headers == self.validator.cross_file_report_headers)
    expected_values = [{'Unique ID': 'TAS: 019-072-X-0306-000', 'Source File': 'appropriations', 'Source Field Name': 'allocationtransferagencyidentifier, agencyidentifier, beginningperiodofavailability, endingperiodofavailability, availabilitytypecode, mainaccountcode, subaccountcode', 'Target File': 'program_activity', 'Target Field Name': , 'Rule Message': 'All TAS values in File A (appropriations) should exist in File B (object class program activity)', 'Source Value Provided': 'allocationtransferagencyidentifier: 019, agencyidentifier: 072, beginningperiodofavailability: , endingperiodofavailability: , availabilitytypecode: X, mainaccountcode: 0306, subaccountcode: 000', 'Target Value Provided': , 'Difference': , 'Source Flex Field': 'flex_field_a: FLEX_A, flex_field_b: FLEX_B', 'Source Row Number': '2', 'Rule Label': 'A30.1'}, {'Unique ID': 'TAS: 019-072-X-0306-000', 'Source File': 'appropriations', 'Source Field Name': 'allocationtransferagencyidentifier, agencyidentifier, beginningperiodofavailability, endingperiodofavailability, availabilitytypecode, mainaccountcode, subaccountcode', 'Target File': 'program_activity', 'Target Field Name': , 'Rule Message': 'All TAS values in File A (appropriations) should exist in File B (object class program activity)', 'Source Value Provided': 'allocationtransferagencyidentifier: 019, agencyidentifier: 072, beginningperiodofavailability: , endingperiodofavailability: , availabilitytypecode: X, mainaccountcode: 0306, subaccountcode: 000', 'Target Value Provided': , 'Difference': , 'Source Flex Field': 'flex_field_a: FLEX_A, flex_field_b: FLEX_B', 'Source Row Number': '7', 'Rule Label': 'A30.1'}, {'Unique ID': 'TAS: 019-072-X-0306-000', 'Source File': 'appropriations', 'Source Field Name': 'allocationtransferagencyidentifier, agencyidentifier, beginningperiodofavailability, endingperiodofavailability, availabilitytypecode, mainaccountcode, subaccountcode', 'Target File': 'program_activity', 'Target Field Name': , 'Rule Message': 'All TAS values in File A (appropriations) should exist in File B (object class program activity)', 'Source Value Provided': 'allocationtransferagencyidentifier: 019, agencyidentifier: 072, beginningperiodofavailability: , endingperiodofavailability: , availabilitytypecode: X, mainaccountcode: 0306, subaccountcode: 000', 'Target Value Provided': , 'Difference': , 'Source Flex Field': 'flex_field_a: FLEX_A, flex_field_b: FLEX_B', 'Source Row Number': '12', 'Rule Label': 'A30.1'}]
    assert (report_content == expected_values)
    self.cleanup()