#NEWLINE# def test_feedback_ids( self ) : #NEWLINE# #INDENT# 'Test various conventions for thread and message ids.' #NEWLINE# exp_id = '0' #NEWLINE# feedback_services . create_thread ( exp_id , 'a_state_name' , None , 'a subject' , 'some text' ) #NEWLINE# threadlist = feedback_services . get_all_threads ( exp_id , False ) #NEWLINE# self . assertEqual ( len ( threadlist ) , 1 ) #NEWLINE# thread_id = threadlist [ 0 ] . get_thread_id ( ) #NEWLINE# self . assertNotIn ( '.' , thread_id ) #NEWLINE# messages = feedback_services . get_messages ( exp_id , thread_id ) #NEWLINE# self . assertEqual ( len ( messages ) , 1 ) #NEWLINE# message_id = messages [ 0 ] . message_id #NEWLINE# self . assertTrue ( isinstance ( message_id , int ) ) #NEWLINE# datastore_id = feedback_models . FeedbackMessageModel . get_messages ( exp_id , thread_id ) [ 0 ] . id #NEWLINE# full_thread_id = feedback_models . FeedbackThreadModel . generate_full_thread_id ( exp_id , thread_id ) #NEWLINE# self . assertEqual ( datastore_id , ( '%s.%s' % ( threadlist , message_id ) ) )