def test_only_show_modules_with_defined_names():
 form = PermissionGroupForm(prefix=None)
 choices = [name for (name, value) in form.fields['modules'].choices]
 assert (AdminModule.name not in choices)

def test_only_show_modules_with_defined_names ( ) : form = PermissionGroupForm ( prefix = None ) choices = [ name for ( name , value ) in form . fields [ 'modules' ] . choices ] assert ( AdminModule . name not in choices )
make sure that only modules with defined names are show as choices in admin .