#NEWLINE# def test_query_by_email_when_primary( self , db_session ) : #NEWLINE# #INDENT# user = DBUserFactory . create ( ) #NEWLINE# email = DBEmailFactory . create ( user = user , primary = True ) #NEWLINE# result = db_session . query ( User ) . filter ( ( User . email == email . email ) ) . first ( ) #NEWLINE# assert ( result == user )