From nobody Fri Apr 26 09:59:24 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=patchew-devel-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=patchew-devel-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1522302458298593.5224133220263; Wed, 28 Mar 2018 22:47:38 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0C59921BB3; Thu, 29 Mar 2018 05:47:37 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 01429600CC; Thu, 29 Mar 2018 05:47:37 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id EC3B34CA96; Thu, 29 Mar 2018 05:47:36 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w2T5lZgq007534 for ; Thu, 29 Mar 2018 01:47:35 -0400 Received: by smtp.corp.redhat.com (Postfix) id E9F705D756; Thu, 29 Mar 2018 05:47:35 +0000 (UTC) Received: from mx1.redhat.com (ext-mx07.extmail.prod.ext.phx2.redhat.com [10.5.110.31]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E270D5D6A6 for ; Thu, 29 Mar 2018 05:47:30 +0000 (UTC) Received: from mail-pg0-f51.google.com (mail-pg0-f51.google.com [74.125.83.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4B47EC03D48F for ; Thu, 29 Mar 2018 05:47:29 +0000 (UTC) Received: by mail-pg0-f51.google.com with SMTP id b9so2409152pgf.6 for ; Wed, 28 Mar 2018 22:47:29 -0700 (PDT) Received: from localhost.localdomain ([112.196.135.186]) by smtp.gmail.com with ESMTPSA id m13sm9375281pgs.25.2018.03.28.22.47.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 28 Mar 2018 22:47:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=xEBKTmMTR1kzXyDPmQWaVKJWv2hYl/Z6DNFkrNjqwPM=; b=sisfnDDe5bdItJP3K9h8F3y4tjh0MIxDAHX/qmGw+1s3+ADhIc0PwVNHXiMaXQOqnk 7TqIZ1k9U3a+tJUAovO937LLsASRw09f1CSLahW/iafk371flixdvUcTer833HM8tIGy fp91vlVQZgT86nPuHEvw7CCvx+zH50TGzBps5Jgmw6flLSCli57/dDrPA3tcuSKiwxDI PgGqsP/FQyMxDuShSJJax2mFDy4uTose9nwJVxWPiFhKsj9MPNZRhgyj//o5vvGVtSjY eEFEUlhby8FbtS1JQyv9hYVHUon62efT7NL6ovw2Iihzlb7ktuAnLVmA5vPYbmXo1f58 KlYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=xEBKTmMTR1kzXyDPmQWaVKJWv2hYl/Z6DNFkrNjqwPM=; b=cGwEmMBBMaoa0tX/6H8ijN0Nd6EZFHm3QVuSkEeYZCIydQAFVG2mVHc1rCbwKllrd3 scPVDf9mJjs4S8WsggoPFeBMcPqgx2tiHYb+AbiZc8IGeADjuwOf6VsWvXNh7WBclwGy Rpl+eNvBYWdKOCRf3t3TctbmZtKbodttf7dLJIjrYZcSkU8jJ36YE2EWHqc+WoZ4WZ6z /h8zbfgDr3cW1zQY/QFedGLEzgecB0br7HjwGGfbiUimVR8cQuZyPe0sWcKjet8CBEPB cQxzLgshnntbbnX6Dv0v5KZ7JBvRJpD5rJPOLV8E5YgzSrY3bWfPTZ6NXF0M1cq2anC2 jJKA== X-Gm-Message-State: AElRT7E7P+zyPCrihV3EYAIVQ3U+RublZg0VVxOWiSbrISpnWmKtESjY cyJWu5gQQQQgWtEm6vrIrs9yYA== X-Google-Smtp-Source: AIpwx48+iMvESlR13gImkG5O3IWRdb9B5EvX9yxnDMV3UNPSTOCNu/IMJiijs7u1hPCP80RVHG/IfA== X-Received: by 10.99.64.3 with SMTP id n3mr3995808pga.13.1522302448312; Wed, 28 Mar 2018 22:47:28 -0700 (PDT) From: Shubham Jain To: patchew-devel@redhat.com Date: Thu, 29 Mar 2018 11:16:21 +0530 Message-Id: <20180329054621.27225-1-shubhamjain7495@gmail.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Thu, 29 Mar 2018 05:47:29 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Thu, 29 Mar 2018 05:47:29 +0000 (UTC) for IP:'74.125.83.51' DOMAIN:'mail-pg0-f51.google.com' HELO:'mail-pg0-f51.google.com' FROM:'shubhamjain7495@gmail.com' RCPT:'' X-RedHat-Spam-Score: 1.62 * (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, RCVD_IN_SORBS_WEB, SPF_PASS) 74.125.83.51 mail-pg0-f51.google.com 74.125.83.51 mail-pg0-f51.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.31 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: patchew-devel@redhat.com Cc: Shubham Jain Subject: [Patchew-devel] [PATCH] rest: add support for series DELETE in the REST API, and a corresponding unit test X-BeenThere: patchew-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Patchew development and discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: patchew-devel-bounces@redhat.com Errors-To: patchew-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Thu, 29 Mar 2018 05:47:37 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" --- api/rest.py | 2 +- tests/test_rest.py | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/api/rest.py b/api/rest.py index 7c131a4..e966559 100644 --- a/api/rest.py +++ b/api/rest.py @@ -231,7 +231,7 @@ class SeriesViewSet(BaseMessageViewSet): search_fields =3D (SEARCH_PARAM,) =20 class ProjectSeriesViewSet(ProjectMessagesViewSetMixin, - SeriesViewSet): + SeriesViewSet,mixins.DestroyModelMixin): def collect_patches(self, series): if series.is_patch: patches =3D [series] diff --git a/tests/test_rest.py b/tests/test_rest.py index 28ca10b..458f54e 100755 --- a/tests/test_rest.py +++ b/tests/test_rest.py @@ -218,6 +218,19 @@ class RestTest(PatchewTestCase): resp =3D self.api_client.get(self.REST_BASE + 'projects/12345/seri= es/?q=3Dproject:QEMU') self.assertEqual(resp.data['count'], 0) =20 + def test_series_delete(self): + resp1 =3D self.apply_and_retrieve('0001-simple-patch.mbox.gz', + self.p.id, '20160628014747.20971-1-= famz@redhat.com') + =20 + resp_before =3D self.api_client.get(self.REST_BASE + 'projects/' += str(self.p.id) + '/series/20160628014747.20971-1-famz@redhat.com/') + self.assertEqual(resp_before.status_code, 200) + + resp =3D self.api_client.delete(self.REST_BASE + 'projects/' + str= (self.p.id) + '/series/20160628014747.20971-1-famz@redhat.com/') + self.assertEqual(resp.status_code, 204) + + resp_after =3D self.api_client.get(self.REST_BASE + 'projects/' + = str(self.p.id) + '/series/20160628014747.20971-1-famz@redhat.com/') + self.assertEqual(resp_after.status_code, 404) + def test_message(self): series =3D self.apply_and_retrieve('0001-simple-patch.mbox.gz', self.p.id, '20160628014747.20971-= 1-famz@redhat.com') --=20 2.14.3 (Apple Git-98) _______________________________________________ Patchew-devel mailing list Patchew-devel@redhat.com https://www.redhat.com/mailman/listinfo/patchew-devel