[#967] Port testsuite's validate_*() functions from SFPy.
[#967] Port testsuite's validate_*() functions from SFPy.

Almost verbatim, minimal rewriting to make it run. TODO: more
restructuring/cleanup.

apache/incubator-allura,apache/incubator-allura,leotrubach/sourceforge-allura,lym/allura-git,apache/allura,Bitergia/allura,apache/allura,heiths/allura,lym/allura-git,Bitergia/allura,heiths/allura,lym/allura-git,heiths/allura,apache/incubator-allura,leotrubach/sourceforge-allura,apache/incubator-allura,leotrubach/sourceforge-allura,heiths/allura,apache/allura,Bitergia/allura,lym/allura-git,lym/allura-git,apache/allura,leotrubach/sourceforge-allura,Bitergia/allura,apache/allura,Bitergia/allura,heiths/allura