'Test inserting a location during prepop with location tree updates disabled'

def testULT1_update_location_tree_disabled(self):

    from s3.s3gis import GIS
    table = self.table
    db = current.db
    gis = current.gis
    L0_lat = 10.0
    L0_lon = (-10.0)
    L0_id = table.insert(level='L0', name='s3gis.testULT1.L0', lat=L0_lat, lon=L0_lon)
    L1_id = table.insert(level='L1', name='s3gis.testULT1.L1', parent=L0_id)
    GIS.disable_update_location_tree = True
    L1_feature = dict(id=L1_id)
    gis.update_location_tree(L1_feature)
    L1_record = db((table.id == L1_id)).select(limitby=(0, 1), *self.fields).first()
    self.assertEqual(L1_record.inherited, False)
    self.assertEqual(L1_record.path, None)
    self.assertEqual(L1_record.lat, None)
    self.assertEqual(L1_record.lon, None)
    GIS.disable_update_location_tree = False
    gis.update_location_tree(L1_feature)
    L1_record = db((table.id == L1_id)).select(limitby=(0, 1), *self.fields).first()
    self.assertEqual(L1_record.inherited, True)
    self.assertEqual(L1_record.path, ('%s/%s' % (L0_id, L1_id)))
    self.assertEqual(L1_record.lat, L0_lat)
    self.assertEqual(L1_record.lon, L0_lon)
