Esempio n. 1
0
 def _data(self):
     """fetch and delete by key"""
     i = interpretation.poot(
         { 'key_string': self.request.get('key_string') })
     if i != None:
         interpretation.delete(i, self.request.get('owner_baton'))
     return i
Esempio n. 2
0
    def test_submit_disapprove(self):
        ## submitting an interpretation should create an inactive one
        i = _stc(interpretation.T_TEXT, 'blart')
        self.assertFalse(i.is_active)

        ## cannot disapprove with no owner_baton
        self.assertRaises(interpretation.BadOwnerBaton, interpretation.delete, i, None)
        ## cannot disapprove with bunk owner_baton
        self.assertRaises(interpretation.BadOwnerBaton, interpretation.delete, i, "blah blah blah")

        ## can delete with correct owner_baton
        interpretation.delete(i, i.owner_baton)