The holder of any certificate of delinquency for general taxes may, before commencing any action to foreclose the lien of such certificate, pay in full all general improvement or divisional district assessments due and outstanding against the whole or any portion of the property included in such certificate of delinquency, and the amount of all assessments so paid together with interest at the rate of twelve percent per annum reckoned from the date of delinquency of said assessments shall be included in the amount for which foreclosure may be had or if said certificate holder elects to foreclose such certificate without paying such assessments, the purchaser at such foreclosure sale shall acquire title to such property subject to all such district assessments.