server/test/unittest_hooks.py
branch3.5
changeset 2923 b97a0f8dd4dc
parent 2921 8e2544e78a5e
child 2968 0e3460341023
child 3526 dfb2ebb765e2
equal deleted inserted replaced
2922:996103009bc5 2923:b97a0f8dd4dc
    57     def test_missing_required_relations_subject_inline(self):
    57     def test_missing_required_relations_subject_inline(self):
    58         # missing in_group relation
    58         # missing in_group relation
    59         self.execute('INSERT CWUser X: X login "toto", X upassword "hop"')
    59         self.execute('INSERT CWUser X: X login "toto", X upassword "hop"')
    60         self.assertRaises(ValidationError,
    60         self.assertRaises(ValidationError,
    61                           self.commit)
    61                           self.commit)
    62 
       
    63     def test_delete_if_singlecard1(self):
       
    64         self.assertEquals(self.repo.schema['in_state'].inlined, False)
       
    65         ueid = self.create_user('toto')
       
    66         self.commit()
       
    67         self.execute('SET X in_state S WHERE S name "deactivated", X eid %(x)s', {'x': ueid})
       
    68         rset = self.execute('Any S WHERE X in_state S, X eid %(x)s', {'x': ueid})
       
    69         self.assertEquals(len(rset), 1)
       
    70         self.commit()
       
    71         self.assertRaises(Exception, self.execute, 'SET X in_state S WHERE S name "deactivated", X eid %s' % ueid)
       
    72         rset2 = self.execute('Any S WHERE X in_state S, X eid %(x)s', {'x': ueid})
       
    73         self.assertEquals(rset.rows, rset2.rows)
       
    74 
    62 
    75     def test_inlined(self):
    63     def test_inlined(self):
    76         self.assertEquals(self.repo.schema['sender'].inlined, True)
    64         self.assertEquals(self.repo.schema['sender'].inlined, True)
    77         self.execute('INSERT EmailAddress X: X address "toto@logilab.fr", X alias "hop"')
    65         self.execute('INSERT EmailAddress X: X address "toto@logilab.fr", X alias "hop"')
    78         self.execute('INSERT EmailPart X: X content_format "text/plain", X ordernum 1, X content "this is a test"')
    66         self.execute('INSERT EmailPart X: X content_format "text/plain", X ordernum 1, X content "this is a test"')