def test_hard_delete_on_vendor_model(self): vendor = Vendor( name='Your name', address='Your Address', tel='12345678', contact_person='Contact Person', ) vendor.save() vendor_id = vendor.id vendor.delete() self.assertEquals(Vendor.query.get(vendor_id), None)
def test_hard_deleting_vendor_gets_logged(self): vendor = Vendor( name='Your name', address='Your Address', tel='12345678', contact_person='Contact Person', ) vendor.save() vendor = Vendor.query.get(1) vendor.delete() activity = [ activity.action_details for activity in Activity.query.all() ] self.assertTrue("hard deleted" in activity[1])