#NEWLINE# def test_serializer_request_assigned_to_related_field( self ) : #NEWLINE# #INDENT# request = self . request_factory . patch ( '/api/cars' , data = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# request . user = self . user1 #NEWLINE# car_serializer = CarSerializer ( instance = self . car , context = { #NEWLINE# #INDENT# 'request' : request , #NEWLINE# #UNINDENT# } ) #NEWLINE# fields = car_serializer . get_fields ( ) #NEWLINE# self . assertIs ( fields [ 'year' ] . context [ 'request' ] , request ) #NEWLINE# self . assertIs ( fields [ 'manufacturer' ] . context [ 'request' ] , request )