#NEWLINE# def setUp( self ) : #NEWLINE# #INDENT# app = flask . Flask ( __name__ ) #NEWLINE# app . config [ 'TESTING' ] = True #NEWLINE# db = fsa . SQLAlchemy ( app ) #NEWLINE# self . Todo = make_todo_model ( db ) #NEWLINE# @ app . route ( '/' ) #NEWLINE# def index( ) : #NEWLINE# #INDENT# return '\n' . join ( ( x . title for x in self . Todo . query . all ( ) ) ) #NEWLINE# #UNINDENT# @ app . route ( '/add' , methods = [ 'POST' ] ) #NEWLINE# def add( ) : #NEWLINE# #INDENT# form = flask . request . form #NEWLINE# todo = self . Todo ( form [ 'title' ] , form [ 'text' ] ) #NEWLINE# db . session . add ( todo ) #NEWLINE# db . session . commit ( ) #NEWLINE# return 'added' #NEWLINE# #UNINDENT# db . create_all ( ) #NEWLINE# self . app = app #NEWLINE# self . db = db