コード例 #1
0
def test_get_total_site_users_for_month(sdm_test_data):
    """
    """
    my_site = sdm_test_data['my_site']
    start_date, end_date = sdm_test_data['our_date_range']
    count = get_total_site_users_for_time_period(
        site=my_site,
        start_date=start_date,
        end_date=end_date)
    assert count == sdm_test_data['expected_count']
コード例 #2
0
ファイル: test_metrics.py プロジェクト: Bhanditz/figures
    def test_get_total_site_users_for_time_period(self):
        '''
        TODO: add users who joined before and after the time period, and
        compare the count to the users created on or before the end date

        TODO: Create
        '''
        users = create_users_joined_over_time(
            start_date=self.data_start_date,
            end_date=self.data_end_date)
        count = metrics.get_total_site_users_for_time_period(
            start_date=self.data_start_date,
            end_date=self.data_end_date,
            calc_raw=True,
            )
        assert count == len(users)
コード例 #3
0
    def test_get_total_site_users_for_time_period(self):
        '''
        TODO: add users who joined before and after the time period, and
        compare the count to the users created on or before the end date

        TODO: Create
        '''
        users = create_users_joined_over_time(
            site=self.alpha_site,
            is_multisite=figures.helpers.is_multisite(),
            start_date=self.data_start_date,
            end_date=self.data_end_date)
        count = get_total_site_users_for_time_period(
            site=self.alpha_site,
            start_date=self.data_start_date,
            end_date=self.data_end_date)
        assert count == len(users)