Reduce sql queries for groupname tests.

Conflicts:
	cms/djangoapps/auth/authz.py