'Test updating a normal L4, with normal L3 Parent'

def _testL4(self, with_level):

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