added test code for towncontroller