Your wife will be fine to take the test now, and the same results will also be valid for the naturalisation application.
One word of caution though....
I'm sorry to say that I think your wife may need to apply for "further leave to remain" before she applies for ILR. From what you have said, her visa expires on 31 October 2007. But she won't have been in the UK for two years when the visa expires - her second anniversary in UK will be 12 December 2007.
And she needs to be in UK for two years before being eligible for ILR...
So I am afraid that your wife may need to apply for further leave (on Form FLR(M)) during the last four weeks of October, and then for ILR later on.
This is just my opinion - by all means check it with IND - there's plenty of time to get a written ruling from them - it's probably not the sort of thing to deal with over the telephone.
good luck
paul