Ejemplo n.º 1
0
    def test_render_with_many(self):
        renderer = GeoJsonRenderer()
        result = json.loads(renderer.render([self.contrib]))

        self.assertEqual(result.get('type'), 'FeatureCollection')
        self.assertEqual(len(result.get('features')), 1)
Ejemplo n.º 2
0
    def test_render_with_single(self):
        renderer = GeoJsonRenderer()
        result = json.loads(renderer.render(self.contrib))

        self.assertTrue('geometry' in result)
        self.assertFalse('geometry' in result.get('location'))
Ejemplo n.º 3
0
    def test_render_with_none(self):
        renderer = GeoJsonRenderer()
        result = renderer.render(None)

        self.assertEqual(result, '')
Ejemplo n.º 4
0
    def test_render_with_many(self):
        renderer = GeoJsonRenderer()
        result = json.loads(renderer.render([self.contrib]))

        self.assertEqual(result.get('type'), 'FeatureCollection')
        self.assertEqual(len(result.get('features')), 1)
Ejemplo n.º 5
0
    def test_render_with_single(self):
        renderer = GeoJsonRenderer()
        result = json.loads(renderer.render(self.contrib))

        self.assertTrue('geometry' in result)
        self.assertFalse('geometry' in result.get('location'))
Ejemplo n.º 6
0
    def test_render_with_none(self):
        renderer = GeoJsonRenderer()
        result = renderer.render(None)

        self.assertEqual(result, '')