pyramid_cubicweb/tests/test_rest_api.py
changeset 11597 286611d1d7a4
parent 11596 1f2570f1d72a
child 11598 2dc0b0db2329
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pyramid_cubicweb/tests/test_rest_api.py	Thu Aug 27 11:25:42 2015 +0200
@@ -0,0 +1,20 @@
+from __future__ import absolute_import
+
+from . import PyramidCWTest
+
+
+class RestApiTest(PyramidCWTest):
+    def includeme(self, config):
+        config.include('pyramid_cubicweb.rest_api')
+
+    def test_delete(self):
+        with self.admin_access.repo_cnx() as cnx:
+            cnx.create_entity('CWGroup', name=u'tmp')
+            cnx.commit()
+
+        self.login()
+        res = self.webapp.delete('/cwgroup/tmp')
+        self.assertEqual(res.status_int, 204)
+
+        with self.admin_access.repo_cnx() as cnx:
+            self.assertEqual(cnx.find('CWGroup', name=u'tmp').rowcount, 0)