コード例 #1
0
ファイル: monthly_stats.py プロジェクト: jinkt/BorIS
 def get_data(self):
     return [
         (aggregation.title, [
             aggregation.get_val(make_key((('town', town.pk),))) for town in self.towns
         ] + [aggregation.get_val(make_key((('grouping_constant', 1),)))]
         ) for aggregation in self.aggregations
     ]
コード例 #2
0
ファイル: yearly_stats.py プロジェクト: vrezac/BorIS
 def get_data(self):
     return [
         (aggregation.title, [
             aggregation.get_val(
                 make_key((('year', self.year), ('town', town.pk)))
             ) for town in self.columns
         ] + [aggregation.get_val(make_key((('year', self.year),)))]) for aggregation in self.aggregations
     ]
コード例 #3
0
ファイル: yearly_stats.py プロジェクト: vrezac/BorIS
 def get_data(self):
     return [
         (aggregation.title, [
             aggregation.get_val(
                 make_key((('year', self.year), ('town__district', district.pk)))
             ) for district in self.columns
         ] + [aggregation.get_val(make_key((('year', self.year),)))]) for aggregation in self.aggregations
     ]
コード例 #4
0
ファイル: monthly_stats.py プロジェクト: ondrocks/BorIS
 def get_data(self):
     return [(month, [(aggregation.title, [
         aggregation.get_val(
             make_key((('month', month), ('town__district', district.pk))))
         for district in self.columns
     ] + [self.get_sum(aggregation, month)])
                      for aggregation in self.aggregations])
             for month in self.months()]
コード例 #5
0
ファイル: yearly_stats.py プロジェクト: vrezac/BorIS
 def get_data(self):
     return [
         (aggregation.title, [
             aggregation.get_val(
                 make_key((('month', month),))
             ) for month in self.columns
         ] + [self.get_sum(aggregation)]) for aggregation in self.aggregations
     ]
コード例 #6
0
 def test_disease_vhc(self):
     tools.assert_true('DiseaseTestVHC' in (dtest.__name__ for dtest in disease_tests))
     for disease_test in disease_tests:
         if disease_test.__name__ == 'DiseaseTestVHC':
             aggregation = disease_test(self.report)
             break
     key = make_key({'month': 11, 'town': self.town1.pk})
     tools.assert_equals(aggregation.get_val(key), 1)
コード例 #7
0
ファイル: test_reports.py プロジェクト: vrezac/BorIS
 def test_disease_vhc(self):
     tools.assert_true('DiseaseTestVHC' in (dtest.__name__
                                            for dtest in disease_tests))
     for disease_test in disease_tests:
         if disease_test.__name__ == 'DiseaseTestVHC':
             aggregation = disease_test(self.report)
             break
     key = make_key({'month': 11, 'town': self.town1.pk})
     tools.assert_equals(aggregation.get_val(key), 1)
コード例 #8
0
ファイル: monthly_stats.py プロジェクト: jinkt/BorIS
 def get_data(self):
     return [
         (month, [
             (aggregation.title, [
                 aggregation.get_val(
                     make_key((('month', month), ('town__district', district.pk)))
                 ) for district in self.columns
             ] + [self.get_sum(aggregation, month)]) for aggregation in self.aggregations
         ]) for month in self.months()
     ]
コード例 #9
0
ファイル: test_reports.py プロジェクト: vrezac/BorIS
 def test_phone_encounter_count(self):
     aggregation = PhoneEncounterCount(self.report)
     key = make_key({'month': 11, 'town': self.town1.pk})
     tools.assert_equals(aggregation.get_val(key), 2)
コード例 #10
0
ファイル: test_reports.py プロジェクト: vrezac/BorIS
 def test_harm_reduction_count(self):
     aggregation = HarmReductionCount(self.report)
     key = make_key({'month': 11, 'town': self.town1.pk})
     tools.assert_equals(aggregation.get_val(key), 3)
コード例 #11
0
ファイル: test_reports.py プロジェクト: vrezac/BorIS
 def test_all_addresses_du(self):
     aggregation = AddressesDU(self.report)
     key = make_key({'month': 11, 'town': self.town1.pk})
     tools.assert_equals(aggregation.get_val(key), 3)
コード例 #12
0
ファイル: test_reports.py プロジェクト: vrezac/BorIS
 def test_parents(self):
     aggregation = ClosePersonEncounters(self.report)
     key = make_key({'month': 11, 'town': self.town1.pk})
     tools.assert_equals(aggregation.get_val(key), 1)
コード例 #13
0
ファイル: test_reports.py プロジェクト: vrezac/BorIS
 def test_gathered_syringes_yearly(self):
     aggregation = GatheredSyringes(self.yearly_report)
     key = make_key({'year': 2011})
     tools.assert_equals(aggregation.get_val(key), 20)
コード例 #14
0
 def test_issued_syringes(self):
     aggregation = IssuedSyringes(self.report)
     key = make_key({'month': 11, 'town': self.town1.pk})
     tools.assert_equals(aggregation.get_val(key), 30)
コード例 #15
0
 def test_harm_reduction_count(self):
     aggregation = HarmReductionCount(self.report)
     key = make_key({'month': 11, 'town': self.town1.pk})
     tools.assert_equals(aggregation.get_val(key), 3)
コード例 #16
0
 def test_first_contact_count_iv(self):
     aggregation = FirstContactCountIV(self.report)
     key = make_key({'month': 11, 'town': self.town1.pk})
     tools.assert_equals(aggregation.get_val(key), 2)
コード例 #17
0
 def test_all_addresses_du(self):
     aggregation = AddressesDU(self.report)
     key = make_key({'month': 11, 'town': self.town1.pk})
     tools.assert_equals(aggregation.get_val(key), 3)
コード例 #18
0
 def test_sex_partners(self):
     aggregation = SexPartnerEncounters(self.report)
     key = make_key({'month': 11, 'town': self.town2.pk})
     tools.assert_equals(aggregation.get_val(key), 1)  # 0
コード例 #19
0
 def test_parents(self):
     aggregation = ClosePersonEncounters(self.report)
     key = make_key({'month': 11, 'town': self.town1.pk})
     tools.assert_equals(aggregation.get_val(key), 1)
コード例 #20
0
 def test_nonclient_encounters(self):
     aggregation = AnonymousAggregation(self.report)
     key = make_key({'month': 11, 'town': self.town1.pk})
     tools.assert_equals(aggregation.get_val(key), 1)
コード例 #21
0
ファイル: test_reports.py プロジェクト: vrezac/BorIS
 def test_all_client_encounters_total_yearly(self):
     aggregation = AllClientEncounters(self.yearly_report)
     key = make_key({'year': 2011})
     tools.assert_equals(aggregation.get_val(key), 3)
コード例 #22
0
ファイル: test_reports.py プロジェクト: vrezac/BorIS
 def test_nonivclient_encounters_yearly(self):
     aggregation = NonIvClientEncounters(self.yearly_report)
     key = make_key({'year': 2011})
     tools.assert_equals(aggregation.get_val(key), 1)
コード例 #23
0
 def test_client_encounter_count(self):
     aggregation = ClientEncounterCount(self.report)
     key = make_key({'month': 11, 'town': self.town1.pk})
     val = aggregation.get_val(key)
     tools.assert_equals(val, 2)
コード例 #24
0
ファイル: monthly_stats.py プロジェクト: ondrocks/BorIS
 def get_sum(self, aggregation, month):
     return aggregation.get_val(make_key((('month', month), )))
コード例 #25
0
 def test_phone_encounter_count(self):
     aggregation = PhoneEncounterCount(self.report)
     key = make_key({'month': 11, 'town': self.town1.pk})
     tools.assert_equals(aggregation.get_val(key), 2)
コード例 #26
0
ファイル: test_reports.py プロジェクト: vrezac/BorIS
 def test_nonclient_encounters(self):
     aggregation = AnonymousAggregation(self.report)
     key = make_key({'month': 11, 'town': self.town1.pk})
     tools.assert_equals(aggregation.get_val(key), 1)
コード例 #27
0
 def test_all_client_encounters_total_monthly(self):
     aggregation = AllClientEncounters(self.monthly_report)
     key = make_key({'month': 11})
     tools.assert_equals(aggregation.get_val(key), 2)
コード例 #28
0
ファイル: test_reports.py プロジェクト: vrezac/BorIS
 def test_sex_partners(self):
     aggregation = SexPartnerEncounters(self.report)
     key = make_key({'month': 11, 'town': self.town2.pk})
     tools.assert_equals(aggregation.get_val(key), 1)  # 0
コード例 #29
0
 def test_all_client_encounters_total_yearly(self):
     aggregation = AllClientEncounters(self.yearly_report)
     key = make_key({'year': 2011})
     tools.assert_equals(aggregation.get_val(key), 3)
コード例 #30
0
ファイル: test_reports.py プロジェクト: vrezac/BorIS
 def test_first_contact_count_iv(self):
     aggregation = FirstContactCountIV(self.report)
     key = make_key({'month': 11, 'town': self.town1.pk})
     tools.assert_equals(aggregation.get_val(key), 2)
コード例 #31
0
 def test_nonivclient_encounters_monthly(self):
     aggregation = NonIvClientEncounters(self.monthly_report)
     key = make_key({'month': 12})
     tools.assert_equals(aggregation.get_val(key), 1)
コード例 #32
0
ファイル: test_reports.py プロジェクト: vrezac/BorIS
 def test_issued_syringes(self):
     aggregation = IssuedSyringes(self.report)
     key = make_key({'month': 11, 'town': self.town1.pk})
     tools.assert_equals(aggregation.get_val(key), 30)
コード例 #33
0
 def test_nonivclient_encounters_yearly(self):
     aggregation = NonIvClientEncounters(self.yearly_report)
     key = make_key({'year': 2011})
     tools.assert_equals(aggregation.get_val(key), 1)
コード例 #34
0
ファイル: test_reports.py プロジェクト: vrezac/BorIS
 def test_client_encounter_count(self):
     aggregation = ClientEncounterCount(self.report)
     key = make_key({'month': 11, 'town': self.town1.pk})
     val = aggregation.get_val(key)
     tools.assert_equals(val, 2)
コード例 #35
0
 def test_gathered_syringes_monthly(self):
     aggregation = GatheredSyringes(self.monthly_report)
     key = make_key({'month': 11})
     tools.assert_equals(aggregation.get_val(key), 15)
コード例 #36
0
ファイル: test_reports.py プロジェクト: vrezac/BorIS
 def test_all_client_encounters_total_monthly(self):
     aggregation = AllClientEncounters(self.monthly_report)
     key = make_key({'month': 11})
     tools.assert_equals(aggregation.get_val(key), 2)
コード例 #37
0
ファイル: yearly_stats.py プロジェクト: vrezac/BorIS
 def get_sum(self, aggregation):
     return aggregation.get_val(make_key((('year', self.year),)))
コード例 #38
0
ファイル: test_reports.py プロジェクト: vrezac/BorIS
 def test_nonivclient_encounters_monthly(self):
     aggregation = NonIvClientEncounters(self.monthly_report)
     key = make_key({'month': 12})
     tools.assert_equals(aggregation.get_val(key), 1)
コード例 #39
0
ファイル: monthly_stats.py プロジェクト: ondrocks/BorIS
 def get_data(self):
     return [(aggregation.title, [
         aggregation.get_val(make_key((('town', town.pk), )))
         for town in self.towns
     ] + [aggregation.get_val(make_key((('grouping_constant', 1), )))])
             for aggregation in self.aggregations]
コード例 #40
0
ファイル: test_reports.py プロジェクト: vrezac/BorIS
 def test_gathered_syringes_monthly(self):
     aggregation = GatheredSyringes(self.monthly_report)
     key = make_key({'month': 11})
     tools.assert_equals(aggregation.get_val(key), 15)
コード例 #41
0
 def test_all_client_encounters(self):
     aggregation = AllClientEncounters(self.report)
     key = make_key({'month': 11, 'town': self.town1.pk})
     tools.assert_equals(aggregation.get_val(key), 3)
コード例 #42
0
ファイル: test_reports.py プロジェクト: vrezac/BorIS
 def test_syringe_collection(self):
     aggregation = SyringeCollectionCount(self.monthly_report)
     key = make_key({'month': 11, 'town': self.town1.pk})
     tools.assert_equals(aggregation.get_val(key), 30)
コード例 #43
0
ファイル: test_reports.py プロジェクト: vrezac/BorIS
 def test_male_client_encounters(self):
     aggregation = MaleClientEncounters(self.report)
     key = make_key({'month': 11, 'town': self.town1.pk})
     tools.assert_equals(aggregation.get_val(key), 2)
コード例 #44
0
 def test_gathered_syringes_yearly(self):
     aggregation = GatheredSyringes(self.yearly_report)
     key = make_key({'year': 2011})
     tools.assert_equals(aggregation.get_val(key), 20)
コード例 #45
0
ファイル: monthly_stats.py プロジェクト: jinkt/BorIS
 def get_sum(self, aggregation, month):
     return aggregation.get_val(make_key((('month', month),)))
コード例 #46
0
 def test_syringe_collection(self):
     aggregation = SyringeCollectionCount(self.monthly_report)
     key = make_key({'month': 11, 'town': self.town1.pk})
     tools.assert_equals(aggregation.get_val(key), 30)
コード例 #47
0
ファイル: test_reports.py プロジェクト: fragaria/BorIS
 def test_all_approaches(self):
     aggregation = AllApproaches(self.report)
     key = make_key({'month': 11, 'town': self.town1.pk})
     tools.assert_equals(aggregation.get_val(key), 5)