#NEWLINE# def test_reversion_history_for_intermediary_model( self ) : #NEWLINE# #INDENT# region_pl = RegionFactory ( ) #NEWLINE# bo_asset = BackOfficeAssetFactory ( region = region_pl ) #NEWLINE# licence = LicenceFactory ( region = region_pl ) #NEWLINE# url = reverse ( 'baseobjectlicence-list' ) #NEWLINE# response = self . client . post ( url , data = { #NEWLINE# #INDENT# 'base_object' : bo_asset . id , #NEWLINE# 'licence' : licence . id , #NEWLINE# #UNINDENT# } ) #NEWLINE# base_object_licence = BaseObjectLicence . objects . get ( pk = response . data [ 'id' ] ) #NEWLINE# history = reversion . get_for_object ( base_object_licence ) #NEWLINE# self . assertEqual ( len ( history ) , 1 ) #NEWLINE# self . assertIn ( '"licence": {}' . format ( region_pl . id ) , history [ 0 ] . serialized_data )