def test_get_previous_cumulative_active_user_count(self, prev_day_data, expected): if prev_day_data: SiteDailyMetricsFactory( date_for=prev_day(self.date_for), **prev_day_data) actual = pipeline_sdm.get_previous_cumulative_active_user_count( date_for=self.date_for) assert actual == expected
def test_get_previous_cumulative_active_user_count_not_yesterday(self): prior_date = days_from(self.date_for, -5) prior_sdm = SiteDailyMetricsFactory(site=self.site, date_for=prior_date, **SDM_DATA[1]) actual = pipeline_sdm.get_previous_cumulative_active_user_count( site=self.site, date_for=self.date_for) assert prior_sdm.cumulative_active_user_count > 0 assert actual == prior_sdm.cumulative_active_user_count