add delete judge server api

This commit is contained in:
virusdefender
2017-01-24 16:48:39 +08:00
parent e98eb5c3c1
commit b9fe8d4669
4 changed files with 28 additions and 16 deletions

View File

@@ -56,7 +56,7 @@ class APIView(View):
response_class = JSONResponse
def _get_request_data(self, request):
if request.method != "GET":
if request.method not in ["GET", "DELETE"]:
body = request.body
content_type = request.META.get("CONTENT_TYPE")
if not content_type:

View File

@@ -27,7 +27,8 @@ class APITestCase(TestCase):
return reverse(url_name)
def assertSuccess(self, response):
self.assertTrue(response.data["error"] is None)
if not response.data["error"] is None:
raise AssertionError("response with errors, response: " + str(response.data))
def assertFailed(self, response):
self.assertTrue(response.data["error"] is not None)