pyramid_cubicweb/tests/test_entities.py
changeset 11596 1f2570f1d72a
equal deleted inserted replaced
11595:9ab8c7100fc0 11596:1f2570f1d72a
       
     1 from __future__ import absolute_import
       
     2 
       
     3 from . import PyramidCWTest
       
     4 
       
     5 
       
     6 class EntitiesTest(PyramidCWTest):
       
     7     def includeme(self, config):
       
     8         config.include('pyramid_cubicweb.entities')
       
     9 
       
    10     def test_delete(self):
       
    11         with self.admin_access.repo_cnx() as cnx:
       
    12             cnx.create_entity('CWGroup', name=u'tmp')
       
    13             cnx.commit()
       
    14 
       
    15         self.login()
       
    16         res = self.webapp.delete('/cwgroup/tmp')
       
    17         self.assertEqual(res.status_int, 204)
       
    18 
       
    19         with self.admin_access.repo_cnx() as cnx:
       
    20             self.assertEqual(cnx.find('CWGroup', name=u'tmp').rowcount, 0)