def make_case2(context):
query = context.session.query(models.IPAddress)<EOL>period_start, period_end = billing.calc_periods()<EOL>ip_list = billing.build_full_day_ips(query, period_start, period_end)<EOL>import random<EOL>ind = random.randint(<NUM_LIT:0>, len(ip_list) - <NUM_LIT:1>)<EOL>address = ip_list[ind]<EOL>address.allocated_at = datetime.datetime.utcnow() -datetime.timedelta(days=<NUM_LIT:1>)<EOL>context.session.add(address)<EOL>context.session.flush()<EOL>
This is a helper method for testing.

    When run with the current context, it will create a case 2 entries
    in the database. See top of file for what case 2 is.