mowilem tylko freenalcer 
return ['freelancer'] == groups

a u Ciebie bylo by ładnie (the python way ^^):
return set(groups) == set(['user', 'freelancer'])