'Test import with approve-attribute'

def testDefaultApproverOverride(self):

    db = current.db
    s3db = current.s3db
    current.auth.override = True
    resource = s3db.resource('org_organisation')
    self.assertEqual(resource.table.approved_by.default, 0)
    resource.import_xml(self.tree)
    table = resource.table
    query = (table.uuid == 'DAOOrganisation1')
    row = db(query).select(table.approved_by, limitby=(0, 1)).first()
    self.assertEqual(row.approved_by, 0)
    query = (table.uuid == 'DAOOrganisation2')
    row = db(query).select(table.approved_by, limitby=(0, 1)).first()
    self.assertEqual(row.approved_by, None)
    current.auth.override = False
