예제 #1
0
 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'])
예제 #2
0
 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)
예제 #3
0
 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'])
예제 #4
0
 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)