From ddcd19a4a65233daaf7c2af175a01615f4e06ff9 Mon Sep 17 00:00:00 2001 From: zhengxie Date: Mon, 8 Oct 2018 10:58:50 +0800 Subject: [PATCH] Upgrade rest_framework to 3.3.3 to fix html render error in web api ref: https://forum.seafile.com/t/6-3-6-pro-api-broken-user-feedback-as-i-go/7356/5 --- requirements.txt | 2 +- tests/api/test_ping.py | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 tests/api/test_ping.py diff --git a/requirements.txt b/requirements.txt index 551b33d70a..a178fbbf0c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,7 +7,7 @@ Django==1.11.15 django-compressor==2.2 django-post-office==3.0.4 django-statici18n==1.7.0 -djangorestframework==3.3.1 +djangorestframework==3.3.3 git+git://github.com/haiwen/django-constance.git@8508ff29141732190faff51d5c2b5474da297732#egg=django-constance[database] openpyxl==2.3.0 pytz==2015.7 diff --git a/tests/api/test_ping.py b/tests/api/test_ping.py new file mode 100644 index 0000000000..da46c58647 --- /dev/null +++ b/tests/api/test_ping.py @@ -0,0 +1,11 @@ +from seahub.test_utils import BaseTestCase + +class PingTest(BaseTestCase): + def test_can_ping(self): + resp = self.client.get('/api2/ping/') + self.assertEqual(200, resp.status_code) + + def test_html_ping(self): + headers = {'HTTP_ACCEPT': 'text/html'} + resp = self.client.get('/api2/ping/', **headers) + self.assertEqual(200, resp.status_code)