[#2280] Make test compatible with python 2.5 and session variables