1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-05 00:43:53 +00:00

file participants update python

This commit is contained in:
sniper-py
2019-06-11 17:21:38 +08:00
committed by Michael An
parent e0e7bfc927
commit c29d990c67
11 changed files with 243 additions and 221 deletions

View File

@@ -8,6 +8,7 @@ from seahub.base.models import FileComment
from seahub.notifications.models import UserNotification
from seahub.test_utils import BaseTestCase
from seahub.file_participants.models import FileParticipant
from seahub.tags.models import FileUUIDMap
class FileCommentsTest(BaseTestCase):
def setUp(self):
@@ -92,8 +93,8 @@ class FileCommentsTest(BaseTestCase):
# share repo and add participant
seafile_api.share_repo(self.repo.id, self.user.username, self.admin.username, 'rw')
FileParticipant.objects.add_by_file_path_and_username(
repo_id=self.repo.id, file_path=self.file, username=self.admin.username)
file_uuid = FileUUIDMap.objects.get_or_create_fileuuidmap_by_path(self.repo.id, self.file, False)
FileParticipant.objects.add_participant(file_uuid, self.admin.username)
resp = self.client.post(self.endpoint, {
'comment': 'new comment'