Esempio n. 1
0
 def test_node_permissions(self):
     self.private_node.add_contributor(self.user_3, permissions=['write', 'read'])
     self.private_sub.email_digest.extend([self.user_3, self.user_4])
     remove = {email_transactional: [], email_digest: [], 'none': []}
     warn = {email_transactional: [], email_digest: [self.user_3._id, self.user_4._id], 'none': []}
     subbed, remove = utils.subscriptions_node_permissions(
         self.private_node,
         warn,
         remove
     )
     assert_equal({email_transactional: [], email_digest: [self.user_3._id], 'none': []}, subbed)
     assert_equal({email_transactional: [], email_digest: [self.user_4._id], 'none': []}, remove)
Esempio n. 2
0
 def test_node_permissions(self):
     self.private_node.add_contributor(self.user_3, permissions=['write', 'read'])
     self.private_sub.email_digest.add(self.user_3, self.user_4)
     remove = {email_transactional: [], email_digest: [], 'none': []}
     warn = {email_transactional: [], email_digest: [self.user_3._id, self.user_4._id], 'none': []}
     subbed, remove = utils.subscriptions_node_permissions(
         self.private_node,
         warn,
         remove
     )
     assert_equal({email_transactional: [], email_digest: [self.user_3._id], 'none': []}, subbed)
     assert_equal({email_transactional: [], email_digest: [self.user_4._id], 'none': []}, remove)