def test_two_week(self): create_periods(self.project, start=self.start, end=self.end) start = self.start - datetime.timedelta(weeks=1) end = self.start create_periods(self.project, start=start, end=end) result = var_kpi_health_weeks(self.project, self.start, self.end, "usv_inq", 2) self.assertEqual(result, 2)
def test_many_periods(self): create_periods(self.project, start=self.start - datetime.timedelta(weeks=1), end=self.start) create_periods(self.project, start=self.start, end=self.end) result = var_all_target_kpis(self.project, self.start, self.end) self.assertEqual(len(result), 2) self.assertListEqual(result, all_target_kpis)
def test_kpi_wrong_date(self): create_periods( self.project, start=self.start - datetime.timedelta(weeks=1), end=self.end - datetime.timedelta(weeks=1), ) result = var_base_targets(self.project, self.start, self.end) self.assertIsNone(result)
def test_have_kpi(self): create_periods( self.project, start=datetime.date(year=2020, month=2, day=3), end=datetime.date(year=2020, month=2, day=12), ) result = var_base_kpis(self.project, self.start, self.end) self.assertIsNotNone(result)
def test_have_kpi(self): create_periods(self.project, start=self.start, end=self.end) result = var_base_targets(self.project, self.start, self.end) expected = { "start": self.start, "end": self.end, "acq_investment": Decimal("1998.43"), "delta_leases": 4, "inquiries": 35, "lease_applications": 7, "lease_cds": 1, "lease_renewal_notices": 3, "lease_renewals": 0, "lease_vacation_notices": 2, "leased_rate": Decimal("0.940"), "leases_executed": 6, "move_ins": 6, "move_outs": 2, "occupied_units": 150, "ret_investment": Decimal("790.00"), "tours": 13, "usvs": 480, } self.assertDictEqual(result, expected)
def setUp(self): project = create_project() create_periods( project, start=datetime.date(year=2019, month=5, day=31), end=datetime.date(year=2019, month=6, day=7), period_params={"leased_units_end": 215}, ) create_periods( project, start=datetime.date(year=2019, month=6, day=7), end=datetime.date(year=2019, month=6, day=14), period_params={"leased_units_end": 215}, ) create_periods( project, start=datetime.date(year=2019, month=6, day=14), end=datetime.date(year=2019, month=6, day=21), ) self.project = project
def test_one_target_period(self): create_periods(self.project, start=self.start, end=self.end) result = var_all_target_kpis(self.project, self.start, self.end) self.assertEqual(len(result), 1) self.assertListEqual(result, all_target_kpis[:1])