#NEWLINE# def setUp( self ) : #NEWLINE# #INDENT# super ( TestCompileSubscriptions , self ) . setUp ( ) #NEWLINE# self . user_1 = factories . UserFactory ( ) #NEWLINE# self . user_2 = factories . UserFactory ( ) #NEWLINE# self . user_3 = factories . UserFactory ( ) #NEWLINE# self . user_4 = factories . UserFactory ( ) #NEWLINE# self . base_project = factories . ProjectFactory ( is_public = False , creator = self . user_1 ) #NEWLINE# self . shared_node = factories . NodeFactory ( parent = self . base_project , is_public = False , creator = self . user_1 ) #NEWLINE# self . private_node = factories . NodeFactory ( parent = self . base_project , is_public = False , creator = self . user_1 ) #NEWLINE# for node in [ self . base_project , self . shared_node , self . private_node ] : #NEWLINE# #INDENT# node . add_contributor ( self . user_2 , permissions = 'admin' ) #NEWLINE# #UNINDENT# self . base_project . add_contributor ( self . user_3 , permissions = 'write' ) #NEWLINE# self . shared_node . add_contributor ( self . user_3 , permissions = 'write' ) #NEWLINE# self . base_sub = factories . NotificationSubscriptionFactory ( _id = ( node . base_project . _id + '_file_updated' ) , owner = self . base_project , event_name = 'file_updated' ) #NEWLINE# self . base_sub . save ( ) #NEWLINE# self . shared_sub = factories . NotificationSubscriptionFactory ( _id = ( self . shared_node . _id + '_file_updated' ) , owner = self . shared_node , event_name = 'file_updated' ) #NEWLINE# self . shared_sub . save ( ) #NEWLINE# self . private_sub = factories . NotificationSubscriptionFactory ( _id = ( self . private_node . _id + '_file_updated' ) , owner = self . private_node , event_name = 'file_updated' ) #NEWLINE# self . private_sub . save ( )