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
def test_get_editors(self): self.quest.editors.connect(self.owner) res = Quest.get_editors(self.owner.username) self.assertIn(self.owner.username, res)