Ejemplo n.º 1
0
 def test_init(self):
     thing = ['any', 'thing']
     privacy = Privacy(thing, True)
     self.assertIs(True, IPrivacy.providedBy(privacy))
     self.assertIs(True, privacy.private)
     privacy = Privacy(thing, False)
     self.assertIs(False, privacy.private)
 def specs(self):
     if (IPrivacy.providedBy(self.context) and self.context.private
             and not check_permission('launchpad.View', self.context)):
         return []
     return self.context.specifications(self.user, filter=self.spec_filter)
 def specs(self):
     if (IPrivacy.providedBy(self.context)
             and self.context.private
             and not check_permission('launchpad.View', self.context)):
         return []
     return self.context.specifications(self.user, filter=self.spec_filter)
Ejemplo n.º 4
0
 def test_forbidden_attribute(self):
     privacy = IPrivacy(ForbiddenAttribute('test'))
     self.assertIs(True, IPrivacy.providedBy(privacy))
     self.assertIs(True, privacy.private)
Ejemplo n.º 5
0
 def test_unauthorized(self):
     privacy = IPrivacy(Unauthorized('test'))
     self.assertIs(True, IPrivacy.providedBy(privacy))
     self.assertIs(True, privacy.private)
Ejemplo n.º 6
0
 def test_exception(self):
     privacy = IPrivacy(IndexError('test'))
     self.assertIs(True, IPrivacy.providedBy(privacy))
     self.assertIs(False, privacy.private)