Fix showing the settings page of a project having custom fields
This worked in python2 but not python3 as the way object can be sorted
changed between both versions.
This commit fixes this and add a test which should now pass on both
py2 and py3.
Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>