예제 #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']))
예제 #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']))
예제 #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
예제 #4
0
파일: adapters.py 프로젝트: elreynol/wold2
 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