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']))
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