def test_post_success(self):
        body = {
            'editor': 'IGN',
            'scale': '25000',
            'code': '3432OT',
            'geometry': {
                'id': 5678, 'version': 6789,
                'geom_detail': '{"type":"Polygon","coordinates":[[[668518.249382151,5728802.39591739],[668518.249382151,5745465.66808356],[689156.247019149,5745465.66808356],[689156.247019149,5728802.39591739],[668518.249382151,5728802.39591739]]]}'  # noqa
            },
            'locales': [
                {'lang': 'en', 'title': 'Lac d\'Annecy'}
            ]
        }
        body, doc = self.post_success(body, user='moderator')
        self.assertIsNotNone(body['geometry'].get('geom_detail'))

        version = doc.versions[0]

        archive_map = version.document_archive
        self.assertEqual(archive_map.editor, 'IGN')
        self.assertEqual(archive_map.scale, '25000')
        self.assertEqual(archive_map.code, '3432OT')

        archive_locale = version.document_locales_archive
        self.assertEqual(archive_locale.lang, 'en')
        self.assertEqual(archive_locale.title, 'Lac d\'Annecy')

        archive_geometry = version.document_geometry_archive
        self.assertEqual(archive_geometry.version, doc.geometry.version)
        self.assertIsNotNone(archive_geometry.geom_detail)
        self.assertIsNotNone(archive_geometry.geom_detail)

        # check that a link for intersecting documents is created
        links = self.session.query(TopoMapAssociation). \
            filter(
                TopoMapAssociation.topo_map_id == doc.document_id). \
            order_by(TopoMapAssociation.document_id). \
            all()
        self.assertEqual(len(links), 2)
        self.assertEqual(links[0].document_id, self.waypoint1.document_id)
        self.check_cache_version(self.waypoint1.document_id, 2)
        self.assertEqual(links[1].document_id, self.route.document_id)
        self.check_cache_version(self.route.document_id, 2)