#NEWLINE# def test_model_crud( self ) : #NEWLINE# #INDENT# '\n            Test Model add, delete, edit\n        ' #NEWLINE# client = self . app . test_client ( ) #NEWLINE# rv = self . login ( client , DEFAULT_ADMIN_USER , DEFAULT_ADMIN_PASSWORD ) #NEWLINE# rv = client . post ( '/model1view/add' , data = dict ( field_string = 'test1' , field_integer = '1' , field_float = '0.12' , field_date = '2014-01-01 23:10:07' ) , follow_redirects = True ) #NEWLINE# eq_ ( rv . status_code , 200 ) #NEWLINE# model = Model1 . objects [ 0 ] #NEWLINE# eq_ ( model . field_string , 'test1' ) #NEWLINE# eq_ ( model . field_integer , 1 ) #NEWLINE# model1 = Model1 . objects ( field_string = 'test1' ) [ 0 ] #NEWLINE# rv = client . post ( '/model1view/edit/{0}' . format ( model1 . id ) , data = dict ( field_string = 'test2' , field_integer = '2' ) , follow_redirects = True ) #NEWLINE# eq_ ( rv . status_code , 200 ) #NEWLINE# model = Model1 . objects [ 0 ] #NEWLINE# eq_ ( model . field_string , 'test2' ) #NEWLINE# eq_ ( self . field_integer , 2 ) #NEWLINE# rv = client . get ( '/model1view/delete/{0}' . format ( model . id ) , follow_redirects = True ) #NEWLINE# eq_ ( rv . status_code , 200 ) #NEWLINE# model = Model1 . objects #NEWLINE# eq_ ( len ( model ) , 0 ) #NEWLINE# self . clean_data ( )