def complete_order(): user = User.objects.get(username='******') plan_pricing = PlanPricing.objects.all()[0] o1 = Order( user=user, plan=plan_pricing.plan, pricing=plan_pricing.pricing, amount=plan_pricing.price, ) o1.save() with freeze_time(random.choice(["2012-01-14", "2012-02-14"])): o1.complete_order()