#NEWLINE# def test_dots( mongodb_backend ) : #NEWLINE# #INDENT# attributes = { #NEWLINE# #INDENT# 'foo.baz.bam' : 'blub' , #NEWLINE# 'foo' : { #NEWLINE# #INDENT# 'baz' : { #NEWLINE# #INDENT# 'bam' : 'bar' , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# doc = Document ( attributes ) #NEWLINE# mongodb_backend . save ( doc ) #NEWLINE# mongodb_backend . commit ( ) #NEWLINE# assert ( mongodb_backend . get ( Document , { #NEWLINE# #INDENT# 'pk' : doc . pk , #NEWLINE# #UNINDENT# } ) == doc ) #NEWLINE# assert ( mongodb_backend . get ( Document , { #NEWLINE# #INDENT# 'foo.baz.bam' : 'bar' , #NEWLINE# #UNINDENT# } ) == doc ) #NEWLINE# assert ( len ( mongodb_backend . filter ( Document , { #NEWLINE# #INDENT# 'foo.baz.bam' : 'bar' , #NEWLINE# #UNINDENT# } ) ) == 1 ) #NEWLINE# with pytest . raises ( Document . DoesNotExist ) : #NEWLINE# #INDENT# mongodb_backend . get ( Document , { #NEWLINE# #INDENT# 'foo.baz.bam' : 'blub' , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# assert ( mongodb_backend . get ( Document , DotEncoder . encode ( { #NEWLINE# #INDENT# 'foo.baz.bam' : 'blub' , #NEWLINE# #UNINDENT# } , [ ] ) ) == doc )