'Test updating a normal L1, with L0 Parent'

def _testL1(self, with_level):

    LEVEL = 'L1'
    POLYGON = 'POLYGON    ((30    11,    39    39,    21    39,    11    20,    30    11))'
    L0 = ('%s_%s' % (self.L0, with_level))
    L1 = ('%s_%s' % (self.L1, with_level))
    L0_id = self.ids[L0]
    table = self.table
    form = Storage(vars=Storage(level=LEVEL, name=L1, parent=L0_id, wkt=POLYGON), errors=None)
    current.gis.wkt_centroid(form)
    L1_id = table.insert(**form.vars)
    S3LocationTreeTests.ids[L1] = L1_id
    feature = dict(id=L1_id)
    if with_level:
        feature['level'] = LEVEL
    current.gis.update_location_tree(feature)
    record = current.db((table.id == L1_id)).select(limitby=(0, 1), *self.fields).first()
    self.assertEqual(record.inherited, False)
    self.assertAlmostEqual(record.lat, 26.675741710296684, 13)
    self.assertAlmostEqual(record.lon, 25.59232111692845, 13)
    self.assertEqual(record.lat_min, 11)
    self.assertEqual(record.lat_max, 39)
    self.assertEqual(record.lon_min, 11)
    self.assertEqual(record.lon_max, 39)
    self.assertEqual(record.parent, L0_id)
    self.assertEqual(record.path, ('%s/%s' % (L0_id, L1_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, None)
    self.assertEqual(record.L4, None)
    self.assertEqual(record.L5, None)
    if self.spatialdb:
        self.assertTrue((record.the_geom is not None))
