#NEWLINE# def testTypeOfReferenceNone( self ) : #NEWLINE# #INDENT# '\n            Test resolution of __typeof queries, for field in referencing\n            table, with None value\n        ' #NEWLINE# db = current . db #NEWLINE# uids = self . uids #NEWLINE# resource = current . s3db . resource ( 'typeof_hierarchy_reference' ) #NEWLINE# expr = FS ( 'typeof_hierarchy_id' ) . typeof ( None ) #NEWLINE# query = expr . query ( resource ) #NEWLINE# table = resource . table #NEWLINE# expected = set ( ( uids [ uid ] for uid in ( 'HIERARCHY1-2' , 'HIERARCHY1-2-1' , 'HIERARCHY1-2-2' ) ) ) #NEWLINE# expected_query = ( expected . typeof_hierarchy_id == None ) #NEWLINE# self . assertEquivalent ( query , expected_query ) #NEWLINE# expr = FS ( 'typeof_hierarchy_id' ) . typeof ( [ None ] ) #NEWLINE# query = expr . query ( resource ) #NEWLINE# table = resource . table #NEWLINE# expected = set ( ( uids [ uid ] for uid in ( 'HIERARCHY1-2' , 'HIERARCHY1-2-1' , 'HIERARCHY1-2-2' ) ) ) #NEWLINE# expected_query = ( table . typeof_hierarchy_id == None ) #NEWLINE# self . assertEquivalent ( query , expected_query ) #NEWLINE# expr = FS ( 'typeof_hierarchy_id' ) . typeof ( [ None , uids [ 'HIERARCHY1-2' ] ] ) #NEWLINE# query = expr . query ( resource ) #NEWLINE# table = resource . table #NEWLINE# expected = set ( ( uids [ uid ] for uid in ( 'HIERARCHY1-2' , 'HIERARCHY1-2-1' , 'HIERARCHY1-2-2' ) ) ) #NEWLINE# expected_query = ( table . typeof_hierarchy_id . belongs ( expected ) | ( table . typeof_hierarchy_id == None ) ) #NEWLINE# self . assertEquivalent ( query , expected_query )