#NEWLINE# def test_model_add_validation( self ) : #NEWLINE# #INDENT# '\n            Test Model add validations\n        ' #NEWLINE# client = self . app . test_client ( ) #NEWLINE# self . login ( rv , DEFAULT_ADMIN_USER , DEFAULT_ADMIN_PASSWORD ) #NEWLINE# rv = client . post ( '/model1view/add' , data = dict ( field_string = 'test1' , field_integer = '1' ) , follow_redirects = True ) #NEWLINE# eq_ ( rv . status_code , 200 ) #NEWLINE# rv = client . post ( '/model1view/add' , data = dict ( field_string = 'test1' , field_integer = '2' ) , follow_redirects = True ) #NEWLINE# eq_ ( rv . status_code , 200 ) #NEWLINE# data = rv . data . decode ( 'utf-8' ) #NEWLINE# ok_ ( ( UNIQUE_VALIDATION_STRING in data ) ) #NEWLINE# model = Model1 . objects ( ) #NEWLINE# eq_ ( len ( model ) , 1 ) #NEWLINE# rv = client . post ( '/model1view/add' , data = dict ( field_string = '' , field_integer = '1' ) , follow_redirects = True ) #NEWLINE# eq_ ( rv . status_code , 200 ) #NEWLINE# data = rv . data . decode ( 'utf-8' ) #NEWLINE# ok_ ( ( NOTNULL_VALIDATION_STRING in data ) ) #NEWLINE# model = Model1 . objects ( ) #NEWLINE# eq_ ( len ( model ) , 1 ) #NEWLINE# self . clean_data ( )