'Test updating an L3, without an L2 Parent, going straight to L1
- this is like Cotabato City & Isabela City in the Philippines'

def _testL3_L1_parent(self, with_level):

    LEVEL = 'L3'
    POLYGON = 'POLYGON    ((30    13,    37    37,    23    37,    13    20,    30    13))'
    L0 = ('%s_%s' % (self.L0, with_level))
    L1 = ('%s_%s' % (self.L1, with_level))
    L3 = 'Test    of    Cotabato    City'
    L0_id = self.ids[L0]
    L1_id = self.ids[L1]
    table = self.table
    form = Storage(vars=Storage(level=LEVEL, name=L3, parent=L1_id, wkt=POLYGON), errors=None)
    current.gis.wkt_centroid(form)
    L3_id = table.insert(**form.vars)
    feature = dict(id=L3_id)
    if with_level:
        feature['level'] = LEVEL
    current.gis.update_location_tree(feature)
    record = current.db((table.id == L3_id)).select(limitby=(0, 1), *self.fields).first()
    self.assertEqual(record.inherited, False)
    self.assertAlmostEqual(record.lat, 26.072901678657075, 13)
    self.assertAlmostEqual(record.lon, 25.867625899280576, 13)
    self.assertEqual(record.lat_min, 13)
    self.assertEqual(record.lat_max, 37)
    self.assertEqual(record.lon_min, 13)
    self.assertEqual(record.lon_max, 37)
    self.assertEqual(record.parent, L1_id)
    self.assertEqual(record.path, ('%s/%s/%s' % (L0_id, L1_id, L3_id)))
    self.assertEqual(record.wkt, POLYGON)
    self.assertEqual(record.L0, L0)
    self.assertEqual(record.L1, L1)
    self.assertEqual(record.L2, None)
    self.assertEqual(record.L3, L3)
    self.assertEqual(record.L4, None)
    self.assertEqual(record.L5, None)
    if self.spatialdb:
        self.assertTrue((record.the_geom is not None))
