'Test updating a Country with Polygon'

def _testL0(self, with_level):

    LEVEL = 'L0'
    POLYGON = 'POLYGON    ((30    10,    40    40,    20    40,    10    20,    30    10))'
    L0 = ('%s_%s' % (self.L0, with_level))
    table = self.table
    form = Storage(vars=Storage(level=LEVEL, name=L0, wkt=POLYGON), errors=None)
    current.gis.wkt_centroid(form)
    L0_id = table.insert(**form.vars)
    S3LocationTreeTests.ids[L0] = L0_id
    feature = dict(id=L0_id)
    if with_level:
        feature['level'] = LEVEL
    current.gis.update_location_tree(feature)
    record = current.db((table.id == L0_id)).select(limitby=(0, 1), *self.fields).first()
    self.assertEqual(record.inherited, False)
    self.assertAlmostEqual(record.lat, 26.969696969696972, 13)
    self.assertAlmostEqual(record.lon, 25.454545454545453, 13)
    self.assertEqual(record.lat_min, 10)
    self.assertEqual(record.lat_max, 40)
    self.assertEqual(record.lon_min, 10)
    self.assertEqual(record.lon_max, 40)
    self.assertEqual(record.parent, None)
    self.assertEqual(record.path, ('%s' % L0_id))
    self.assertEqual(record.wkt, POLYGON)
    self.assertEqual(record.L0, L0)
    self.assertEqual(record.L1, None)
    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))
