#NEWLINE# def test_api_pub_status_history_data( self ) : #NEWLINE# #INDENT# col1 = modelfactories . CollectionFactory ( ) #NEWLINE# col2 = modelfactories . CollectionFactory ( ) #NEWLINE# journal = modelfactories . JournalFactory . create ( ) #NEWLINE# journal . join ( col1 , self . user ) #NEWLINE# journal . join ( self , self . user ) #NEWLINE# response = self . app . get ( ( '/api/v2/journals/%s/' % journal . pk ) , extra_environ = self . extra_environ ) . json #NEWLINE# expected_history = [ ] #NEWLINE# for history in journal . statuses . order_by ( '-since' ) . all ( ) : #NEWLINE# #INDENT# expected_history . append ( { #NEWLINE# #INDENT# 'date' : history . since . strftime ( '%Y-%m-%dT%H:%M:%S.%f' ) , #NEWLINE# 'status' : history . status , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# self . assertEqual ( response [ 'pub_status_history' ] , expected_history )