#NEWLINE# def test_cant_register_for_other_users( self ) : #NEWLINE# #INDENT# wrong_user = UserFactory ( ) #NEWLINE# self . data [ 'creator' ] = self #NEWLINE# serializer = api . PushNotificationRegistrationSerializer ( context = self . context , data = self . data ) #NEWLINE# ok_ ( ( not serializer . is_valid ( ) ) ) #NEWLINE# eq_ ( serializer . errors , { #NEWLINE# #INDENT# 'creator' : [ "Can't register push notifications for another user." ] , #NEWLINE# #UNINDENT# } )