<s> from flask . ext import wtf <EOL> import flask <EOL> import wtforms <EOL> import auth <EOL> import util <EOL> from main import app <EOL> TESTS = [ <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT:label>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> ] <EOL> class TestForm ( wtf . Form ) : <EOL> name = wtforms . StringField ( <EOL> '<STR_LIT>' , <EOL> [ wtforms . validators . required ( ) ] , filters = [ util . strip_filter ] , <EOL> description = '<STR_LIT>' , <EOL> ) <EOL> number = wtforms . IntegerField ( '<STR_LIT>' , [ wtforms . validators . optional ( ) ] ) <EOL> email = wtforms . StringField ( <EOL> '<STR_LIT>' , <EOL> [ wtforms . validators . optional ( ) , wtforms . validators . email ( ) ] , <EOL> filters = [ util . email_filter ] , <EOL> ) <EOL> date = wtforms . DateField ( '<STR_LIT>' , [ wtforms . validators . optional ( ) ] ) <EOL> textarea = wtforms . TextAreaField ( '<STR_LIT>' ) <EOL> boolean = wtforms . BooleanField ( <EOL> '<STR_LIT>' , <EOL> [ wtforms . validators . optional ( ) ] , <EOL> ) <EOL> password = wtforms . PasswordField ( <EOL> '<STR_LIT>' , <EOL> [ wtforms . validators . optional ( ) , wtforms . validators . length ( min = <NUM_LIT:6> ) ] , <EOL> ) <EOL> password_visible = wtforms . StringField ( <EOL> '<STR_LIT>' , <EOL> [ wtforms . validators . optional ( ) , wtforms . validators . length ( min = <NUM_LIT:6> ) ] , <EOL> description = '<STR_LIT>' <EOL> ) <EOL> prefix = wtforms . StringField ( '<STR_LIT>' , [ wtforms . validators . optional ( ) ] ) <EOL> suffix = wtforms . StringField ( '<STR_LIT>' , [ wtforms . validators . required ( ) ] ) <EOL> both = wtforms . IntegerField ( '<STR_LIT>' , [ wtforms . validators . required ( ) ] ) <EOL> select = wtforms . SelectField ( <EOL> '<STR_LIT>' , <EOL> [ wtforms . validators . optional ( ) ] , <EOL> choices = [ ( s , s . title ( ) ) for s in [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] ] <EOL> ) <EOL> checkboxes = wtforms . SelectMultipleField ( <EOL> '<STR_LIT>' , <EOL> [ wtforms . validators . required ( ) ] , <EOL> choices = [ ( c , c . title ( ) ) for c in [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] ] <EOL> ) <EOL> radios = wtforms . SelectField ( <EOL> '<STR_LIT>' , <EOL> [ wtforms . validators . optional ( ) ] , <EOL> choices = [ ( r , r . title ( ) ) for r in [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] ] <EOL> ) <EOL> public = wtforms . StringField ( '<STR_LIT>' , [ wtforms . validators . optional ( ) ] ) <EOL> private = wtforms . StringField ( '<STR_LIT>' , [ wtforms . validators . optional ( ) ] ) <EOL> recaptcha = wtf . RecaptchaField ( ) <EOL> @ app . route ( '<STR_LIT>' , methods = [ '<STR_LIT:GET>' , '<STR_LIT:POST>' ] ) <EOL> @ app . route ( '<STR_LIT>' , methods = [ '<STR_LIT:GET>' , '<STR_LIT:POST>' ] ) <EOL> @ auth . admin_required <EOL> def admin_test ( test = None ) : <EOL> if test and test not in TESTS : <EOL> flask . abort ( <NUM_LIT> ) <EOL> form = TestForm ( ) <EOL> if form . validate_on_submit ( ) : <EOL> pass <EOL> return flask . render_template ( <EOL> '<STR_LIT>' if test else '<STR_LIT>' , <EOL> title = '<STR_LIT>' % test . title ( ) if test else '<STR_LIT>' , <EOL> html_class = '<STR_LIT:test>' , <EOL> form = form , <EOL> test = test , <EOL> tests = TESTS , <EOL> back_url_for = '<STR_LIT>' if test else None , <EOL> ) </s>
