Exemple #1
0
    def test_GeoJsonLanguages(self):
        from clld.web.adapters import GeoJsonLanguages

        class MockLanguages(Mock):
            def get_query(self, *args, **kw):
                return [Language.first()]

        adapter = GeoJsonLanguages(None)
        self.assertTrue(
            '{' in adapter.render(MockLanguages(), self.env['request']))
Exemple #2
0
    def test_GeoJsonLanguages(self):
        from clld.web.adapters import GeoJsonLanguages

        class MockLanguages(Mock):
            def get_query(self, *args, **kw):
                return [Language.first()]

        adapter = GeoJsonLanguages(None)
        self.assertTrue(
            '{' in adapter.render(MockLanguages(), self.env['request']))
Exemple #3
0
 def feature_properties(self, ctx, req, feature):
     res = GeoJsonLanguages.feature_properties(self, ctx, req, feature)
     res['recipient'] = 'y' if feature.vocabulary_pk else 'n'
     return res
Exemple #4
0
 def feature_properties(self, ctx, req, feature):
     res = GeoJsonLanguages.feature_properties(self, ctx, req, feature)
     res['recipient'] = 'y' if feature.vocabulary_pk else 'n'
     return res