#NEWLINE# def test_get_by_hash_behavior_with_sent_datetime_lower_bound( self ) : #NEWLINE# #INDENT# with self . generate_constant_hash_ctx : #NEWLINE# #INDENT# time_now = datetime . datetime . utcnow ( ) #NEWLINE# email_models . SentEmailModel . create ( 'recipient_id' , 'recipient@email.com' , 'sender_id' , 'sender@email.com' , feconf . EMAIL_INTENT_SIGNUP , 'Email Subject' , 'Email Body' , datetime . datetime . utcnow ( ) ) #NEWLINE# results = email_models . SentEmailModel . get_by_hash ( 'Email Hash' , sent_datetime_lower_bound = time_now ) #NEWLINE# self . assertEqual ( len ( results ) , 1 ) #NEWLINE# time_now1 = datetime . datetime . utcnow ( ) #NEWLINE# results = email_models . SentEmailModel . get_by_hash ( 'Email Hash' , sent_datetime_lower_bound = time_now1 ) #NEWLINE# self . assertEqual ( len ( results ) , 0 ) #NEWLINE# time_before = ( datetime . datetime . utcnow ( ) - datetime . timedelta ( minutes = 10 ) ) #NEWLINE# results = email_models . SentEmailModel . get_by_hash ( 'Email Hash' , sent_datetime_lower_bound = time_before ) #NEWLINE# self . assertEqual ( len ( results ) , 1 ) #NEWLINE# with self . assertRaises ( Exception ) : #NEWLINE# #INDENT# results = email_models . SentEmailModel . get_by_hash ( 'Email Hash' , sent_datetime_lower_bound = 'Not a datetime object' )