Always check with your tax advisor to make sure, but this should not be a problem. The way I understand the provisions, you can contract by April and close even a month or two later. I ALWAYS ALWAYS ALWAYS suggest that if you purchase a home together with an unmarried person that you go to your family attorney and draw up some kind of pre/nup. If you don't want to do this, you are not alone, but there have been plenty of people deep in love that don't get married as planned. It is certainly worth $200 or a few dollars to have an attorney draw up some simple agreement that lasts until the wedding is complete.
Good luck....plan for the best, prepare for the worst and you'll be just fine.