'Test override of owners in is_owner'

def testOwnershipOverride(self):

    auth = current.auth
    s3_impersonate = auth.s3_impersonate
    is_owner = auth.permission.is_owner
    assertTrue = self.assertTrue
    assertFalse = self.assertFalse
    auth.s3_clear_session_ownership()
    table = self.table
    record_id = self.record_id
    org = current.s3db.pr_get_pe_id('org_organisation', 1)
    role = self.role_id
    user_id = auth.s3_get_user_id('admin@example.com')
    current.db((table.id == record_id)).update(realm_entity=org, owned_by_group=role, owned_by_user=user_id)
    auth.s3_impersonate('normaluser@example.com')
    assertFalse(auth.permission.is_owner(table, record_id))
    owners_override = (None, None, None)
    assertTrue(is_owner(table, record_id, owners=owners_override))
