add test code based on web2py 2.9.3