'Test archiving if there are mandatory extra fields
which require a join'

def testArchiveWithJoinedExtraFields(self):

    assertEqual = self.assertEqual
    assertNotEqual = self.assertNotEqual
    assertTrue = self.assertTrue
    s3db = current.s3db
    master_id = self.master_id
    s3db.define_table('del_component', Field('del_master_id', s3db.del_master, ondelete='CASCADE'), *s3_meta_fields())
    component = s3db['del_component']
    s3db.configure('del_component', extra_fields=['del_master_id$id'])
    try:
        component_id = component.insert(del_master_id=master_id)
        component_record = component[component_id]
        assertNotEqual(component_record, None)
        current.db.commit()
        resource = s3db.resource('del_component', id=component_id)
        success = resource.delete()
        assertEqual(success, 1)
        assertEqual(resource.error, None)
        component_record = component[component_id]
        assertTrue(component_record.deleted)
        assertEqual(component_record.del_master_id, None)
        assertEqual(self.component_deleted, component_id)
    finally:
        component.drop()
