'Test delete_super with RESTRICT constraint'

def testDeleteSuperRestrict(self):

    s3db = current.s3db
    master_table = s3db.setest_master
    record = master_table[self.master_id]
    se_id = record.se_id
    component_table = s3db.setest_component_restrict
    component_id = component_table.insert(se_id=se_id)
    component_record = component_table[component_id]
    self.assertNotEqual(component_record, None)
    success = s3db.delete_super(master_table, record)
    self.assertFalse(success)
    record = master_table[self.master_id]
    self.assertEqual(record.se_id, se_id)
    component_record = component_table[component_id]
    self.assertFalse(component_record.deleted)
    self.assertEqual(component_record.se_id, se_id)
    super_table = s3db.setest_super
    super_record = super_table[se_id]
    self.assertFalse(super_record.deleted)
