예제 #1
0
 def has_object_permission(self, request, view, obj):
     if request.user.username in Quest.get_editors(obj) or \
             request.user.username == obj:
         return True
     else:
         return False
예제 #2
0
 def test_get_editors(self):
     self.quest.editors.connect(self.owner)
     res = Quest.get_editors(self.owner.username)
     self.assertIn(self.owner.username, res)