Ticket #23960 make tests run with python 2.4

Made changes to get tests to run in python 2.4. Status can go back to ip after code review.