#NEWLINE# def test_field_with_special_values( self ) : #NEWLINE# #INDENT# class TestModel ( CollectionModel ) : #NEWLINE# #INDENT# list_field = ListField ( null = False ) #NEWLINE# #UNINDENT# TestModel . init ( ) #NEWLINE# model = TestModel ( ) #NEWLINE# model . list_field = ( 13 , { #NEWLINE# #INDENT# 'test' : 'foo' , #NEWLINE# #UNINDENT# } , [ 50 , 60 ] ) #NEWLINE# model . save ( ) #NEWLINE# documents = TestModel . collection_instance . documents ( ) #NEWLINE# self . assertEqual ( len ( documents ) , 1 ) #NEWLINE# doc1 = documents [ 0 ] #NEWLINE# self . assertTrue ( isinstance ( doc1 . list_field , list ) ) #NEWLINE# self . assertEqual ( len ( doc1 . list_field ) , 3 ) #NEWLINE# val1 = doc1 . list_field [ 0 ] #NEWLINE# val2 = doc1 . list_field [ 1 ] #NEWLINE# val3 = doc1 . list_field [ 2 ] #NEWLINE# self . assertTrue ( isinstance ( val1 , int ) ) #NEWLINE# self . assertTrue ( isinstance ( val2 , dict ) ) #NEWLINE# self . assertTrue ( isinstance ( val3 , list ) ) #NEWLINE# TestModel . destroy ( )