def test_get_maps(self):
        update_map(self.map1)
        maps = get_maps(self.waypoint1, 'en')

        self.assertEqual(len(maps), 1)
        self.assertEqual(
            maps[0].document_id, self.map1.document_id)
    def test_get_maps_forwarded(self):
        """Tests that forwarded maps are not included.
        """
        # add an association with wp1
        self.session.add(TopoMapAssociation(
            document_id=self.waypoint1.document_id,
            topo_map_id=self.map2.document_id))
        self.session.flush()
        areas = get_maps(self.waypoint1, 'en')

        self.assertEqual(len(areas), 0)
Example #3
0
 def _set_maps(self, document, lang):
     topo_maps = get_maps(document, lang)
     document.maps = [
         to_json_dict(m, schema_listing_topo_map) for m in topo_maps
     ]
Example #4
0
 def _set_maps(self, document, lang):
     topo_maps = get_maps(document, lang)
     document.maps = [
         to_json_dict(m, schema_listing_topo_map) for m in topo_maps
     ]