def test_blanks(self):
     file_path = os.path.join(os.path.dirname(os.path.abspath(__file__)),
                              '..', '..', 'tests', 'fixtures',
                              "new_format.xlsx")
     report = FreeFormReport(file_path, "May Jun").load()
     report.cycle = "Jul - Aug 2015"
     cases = [{
         'test': BlanksQualityCheck,
         'expected': NOT_REPORTING
     }, {
         'test': MultipleCheck,
         'expected': YES
     }, {
         'test': IsReportingCheck,
         'expected': YES
     }, {
         'test': WebBasedCheck,
         'expected': WEB
     }]
     for case in cases:
         check = case['test']()
         for combination in check.combinations:
             report.locs[0]['scores'][check.test][
                 combination[NAME]] = check.for_each_facility(
                     build_facility_data(report.locs[0], report),
                     combination)
         self.assertEquals(
             report.locs[0]["scores"][case['test'].test][DEFAULT],
             case['expected'])
 def test_web_based_results(self):
     file_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), '..', '..', 'tests', 'fixtures',
                              "new_format.xlsx")
     report = FreeFormReport(file_path, "May - Jun").load()
     report.cycle = "Jul - Aug 2015"
     cases = [
         {'test': WebBasedCheck, 'expected': 96.0, 'score': WEB}
     ]
     for case in cases:
         check = case['test']()
         for combination in check.combinations:
             report.locs[0]['scores'][check.test][combination[NAME]] = check.for_each_facility(report.locs[0], combination)
         persist_scores(report)
         self.assertEquals(Score.objects.count(), 24)
         self.assertEquals(Score.objects.all()[0].WEB_BASED[DEFAULT], WEB)
 def test_blanks(self):
     file_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), '..', '..', 'tests', 'fixtures',
                              "new_format.xlsx")
     report = FreeFormReport(file_path, "May Jun").load()
     report.cycle = "Jul - Aug 2015"
     cases = [
         {'test': BlanksQualityCheck, 'expected': NOT_REPORTING},
         {'test': MultipleCheck, 'expected': YES},
         {'test': IsReportingCheck, 'expected': YES},
         {'test': WebBasedCheck, 'expected': WEB}
     ]
     for case in cases:
         check = case['test']()
         for combination in check.combinations:
             report.locs[0]['scores'][check.test][combination[NAME]] = check.for_each_facility(build_facility_data(report.locs[0], report), combination)
         self.assertEquals(report.locs[0]["scores"][case['test'].test][DEFAULT], case['expected'])
 def test_web_based_results(self):
     file_path = os.path.join(os.path.dirname(os.path.abspath(__file__)),
                              '..', '..', 'tests', 'fixtures',
                              "new_format.xlsx")
     report = FreeFormReport(file_path, "May - Jun").load()
     report.cycle = "Jul - Aug 2015"
     cases = [{'test': WebBasedCheck, 'expected': 96.0, 'score': WEB}]
     for case in cases:
         check = case['test']()
         for combination in check.combinations:
             report.locs[0]['scores'][check.test][
                 combination[NAME]] = check.for_each_facility(
                     report.locs[0], combination)
         persist_scores(report)
         self.assertEquals(Score.objects.count(), 24)
         self.assertEquals(Score.objects.all()[0].WEB_BASED[DEFAULT], WEB)