fix reset gender field bug in settings page
add test database and enhance unit test