def METHOD_NAME(self):
    lead = Lead.objects.get(id=1)
    mission = lead.mission_set.first()
    mission.billing_mode = "TIME_SPENT"
    mission.save()
    ClientBill.objects.filter(lead=lead).delete()
    bill = ClientBill(lead=lead, creation_date=date(2010, 10, 5), state="1_SENT")
    bill.save()
    self.assertIsNone(bill.creation_lag())
    detail = BillDetail(bill=bill, mission=mission, quantity=10, unit_price=1000, month=date(2010, 9, 1))
    detail.save()
    self.assertEqual(bill.creation_lag(), 4)
    detail2 = BillDetail(bill=bill, mission=mission, quantity=10, unit_price=1000, month=date(2010, 8, 1))
    detail2.save()
    self.assertEqual(bill.creation_lag(), 34)
    detail.delete()
    self.assertEqual(bill.creation_lag(), 34)