Exemplo n.º 1
0
    def test_map_thumbnail(self):
        """Test the map save method generates a thumbnail link
        """
        # TODO: Would be nice to ensure the name is available before
        # running the test...
        norman = get_user_model().objects.get(username="******")
        saved_layer = file_upload(
            os.path.join(
                gisdata.VECTOR_DATA,
                "san_andres_y_providencia_poi.shp"),
            name="san_andres_y_providencia_poi_by_norman",
            user=norman,
            overwrite=True,
        )
        try:
            self.client.login(username='******', password='******')

            saved_layer.set_default_permissions()
            map_obj = Map(owner=norman, zoom=0,
                          center_x=0, center_y=0)
            map_obj.create_from_layer_list(norman, [saved_layer], 'title', '')

            thumbnail_url = map_obj.get_thumbnail_url()

            self.assertNotEqual(thumbnail_url, staticfiles.static(settings.MISSING_THUMBNAIL))
        finally:
            # Cleanup
            saved_layer.delete()
Exemplo n.º 2
0
    def test_map_thumbnail(self):
        """Test the map save method generates a thumbnail link
        """
        # TODO: Would be nice to ensure the name is available before
        # running the test...
        norman = get_user_model().objects.get(username="******")
        saved_layer = file_upload(
            os.path.join(gisdata.VECTOR_DATA,
                         "san_andres_y_providencia_poi.shp"),
            name="san_andres_y_providencia_poi_by_norman",
            user=norman,
            overwrite=True,
        )
        try:
            self.client.login(username='******', password='******')

            saved_layer.set_default_permissions()
            map_obj = Map(owner=norman, zoom=0, center_x=0, center_y=0)
            map_obj.create_from_layer_list(norman, [saved_layer], 'title', '')

            thumbnail_url = map_obj.get_thumbnail_url()

            self.assertNotEqual(thumbnail_url,
                                staticfiles.static(settings.MISSING_THUMBNAIL))
        finally:
            # Cleanup
            saved_layer.delete()
Exemplo n.º 3
0
    def test_map_thumbnail(self):
        """Test the map save method generates a thumbnail link
        """
        client = Client()
        client.login(username='******', password='******')

        #TODO: Would be nice to ensure the name is available before
        #running the test...
        norman = User.objects.get(username="******")
        saved_layer = file_upload(
             os.path.join(gisdata.VECTOR_DATA, "san_andres_y_providencia_poi.shp"),
             name="san_andres_y_providencia_poi_by_norman",
             user=norman,
             overwrite=True,
        )

        map_obj = Map(owner=norman, zoom=0,
                      center_x=0, center_y=0)
        map_obj.create_from_layer_list(norman, [saved_layer], 'title','')

        thumbnail_url = map_obj.get_thumbnail_url()

        assert thumbnail_url != staticfiles.static(settings.MISSING_THUMBNAIL)
Exemplo n.º 4
0
    def test_map_thumbnail(self):
        """Test the map save method generates a thumbnail link
        """
        client = Client()
        client.login(username='******', password='******')

        #TODO: Would be nice to ensure the name is available before
        #running the test...
        norman = User.objects.get(username="******")
        saved_layer = file_upload(
            os.path.join(gisdata.VECTOR_DATA,
                         "san_andres_y_providencia_poi.shp"),
            name="san_andres_y_providencia_poi_by_norman",
            user=norman,
            overwrite=True,
        )

        map_obj = Map(owner=norman, zoom=0, center_x=0, center_y=0)
        map_obj.create_from_layer_list(norman, [saved_layer], 'title', '')

        thumbnail_url = map_obj.get_thumbnail_url()

        assert thumbnail_url != staticfiles.static(settings.MISSING_THUMBNAIL)