mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-01 15:09:14 +00:00
add test for web-api use new seafile api
This commit is contained in:
20
tests/api/test_html_repo_history_changes.py
Normal file
20
tests/api/test_html_repo_history_changes.py
Normal file
@@ -0,0 +1,20 @@
|
||||
from django.test import RequestFactory
|
||||
|
||||
from seahub.api2.views import html_repo_history_changes
|
||||
from seahub.test_utils import BaseTestCase
|
||||
|
||||
class RepoTest(BaseTestCase):
|
||||
def setUp(self):
|
||||
# Every test needs access to the request factory.
|
||||
self.factory = RequestFactory()
|
||||
|
||||
# Create an instance of a GET request.
|
||||
self.request = self.factory.get('/foo/')
|
||||
|
||||
self.request.user = self.user
|
||||
self.request.cloud_mode = False
|
||||
|
||||
def test_can_not_get_without_commit_id(self):
|
||||
repo = self.repo
|
||||
resp = html_repo_history_changes(self.request, repo.id)
|
||||
self.assertEqual(400, resp.status_code)
|
Reference in New Issue
Block a user