add delete judge server api
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user