def test_calc_return_requests(self): """Test calculating the return requests""" composer = FOIAComposerFactory( status='submitted', agencies=AgencyFactory.create_batch(6), num_org_requests=1, num_monthly_requests=2, num_reg_requests=3, user__profile__num_requests=5, user__profile__monthly_requests=10, user__profile__organization=OrganizationFactory(num_requests=100), ) values = [ (7, 4, 2, 1), (6, 3, 2, 1), (5, 3, 2, 0), (4, 3, 1, 0), (3, 3, 0, 0), (2, 2, 0, 0), (1, 1, 0, 0), ] for total, reg, monthly, org in values: eq_( composer._calc_return_requests(total), { 'regular': reg, 'monthly': monthly, 'org': org, }, )
def test_calc_return_requests(self): """Test calculating the return requests""" composer = FOIAComposerFactory( status="submitted", agencies=AgencyFactory.create_batch(6), num_monthly_requests=2, num_reg_requests=3, ) values = [(6, 4, 2), (5, 3, 2), (4, 3, 1), (3, 3, 0), (2, 2, 0), (1, 1, 0)] for total, reg, monthly in values: eq_( composer._calc_return_requests(total), {"regular": reg, "monthly": monthly}, )