A POST value `test` will break the code with a ValueError (cannot convert to int). What about this?

    flip = unicode(request.POST.get('flip')).lower() in ['1', 'yes', 'y', 'true']