Python django.contrib.sitemaps.GenericSitemap() Examples

The following are code examples for showing how to use django.contrib.sitemaps.GenericSitemap(). They are from open source Python projects. You can vote up the examples you like or vote down the ones you don't like.

Example 1
Project: TESTGIT   Author: B-ROY   File: test_http.py    Apache License 2.0 5 votes vote down vote up
def test_sitemap_item(self):
        """
        Check to make sure that the raw item is included with each
        Sitemap.get_url() url result.
        """
        test_sitemap = GenericSitemap({'queryset': TestModel.objects.all()})
        def is_testmodel(url):
            return isinstance(url['item'], TestModel)
        item_in_url_info = all(map(is_testmodel, test_sitemap.get_urls()))
        self.assertTrue(item_in_url_info) 
Example 2
Project: AneMo   Author: jspargo   File: test_http.py    GNU General Public License v2.0 5 votes vote down vote up
def test_sitemap_item(self):
        """
        Check to make sure that the raw item is included with each
        Sitemap.get_url() url result.
        """
        test_sitemap = GenericSitemap({'queryset': TestModel.objects.all()})

        def is_testmodel(url):
            return isinstance(url['item'], TestModel)
        item_in_url_info = all(map(is_testmodel, test_sitemap.get_urls()))
        self.assertTrue(item_in_url_info) 
Example 3
Project: forum-xblock   Author: DANCEcollaborative   File: http.py    MIT License 5 votes vote down vote up
def test_sitemap_item(self):
        """
        Check to make sure that the raw item is included with each
        Sitemap.get_url() url result.
        """
        user_sitemap = GenericSitemap({'queryset': User.objects.all()})
        def is_user(url):
            return isinstance(url['item'], User)
        item_in_url_info = all(map(is_user, user_sitemap.get_urls()))
        self.assertTrue(item_in_url_info) 
Example 4
Project: global-ssh-server   Author: nthiep   File: http.py    GNU Affero General Public License v3.0 5 votes vote down vote up
def test_sitemap_item(self):
        """
        Check to make sure that the raw item is included with each
        Sitemap.get_url() url result.
        """
        test_sitemap = GenericSitemap({'queryset': TestModel.objects.all()})
        def is_testmodel(url):
            return isinstance(url['item'], TestModel)
        item_in_url_info = all(map(is_testmodel, test_sitemap.get_urls()))
        self.assertTrue(item_in_url_info) 
Example 5
Project: MONITT   Author: meeeejin   File: test_http.py    MIT License 5 votes vote down vote up
def test_sitemap_item(self):
        """
        Check to make sure that the raw item is included with each
        Sitemap.get_url() url result.
        """
        test_sitemap = GenericSitemap({'queryset': TestModel.objects.all()})
        def is_testmodel(url):
            return isinstance(url['item'], TestModel)
        item_in_url_info = all(map(is_testmodel, test_sitemap.get_urls()))
        self.assertTrue(item_in_url_info) 
Example 6
Project: CMPUT410W15-project   Author: CMPUT410W15T02   File: test_http.py    GNU General Public License v2.0 5 votes vote down vote up
def test_sitemap_item(self):
        """
        Check to make sure that the raw item is included with each
        Sitemap.get_url() url result.
        """
        test_sitemap = GenericSitemap({'queryset': TestModel.objects.all()})

        def is_testmodel(url):
            return isinstance(url['item'], TestModel)
        item_in_url_info = all(map(is_testmodel, test_sitemap.get_urls()))
        self.assertTrue(item_in_url_info) 
Example 7
Project: alarm   Author: G8bao7   File: test_http.py    Apache License 2.0 5 votes vote down vote up
def test_sitemap_item(self):
        """
        Check to make sure that the raw item is included with each
        Sitemap.get_url() url result.
        """
        test_sitemap = GenericSitemap({'queryset': TestModel.objects.all()})

        def is_testmodel(url):
            return isinstance(url['item'], TestModel)
        item_in_url_info = all(map(is_testmodel, test_sitemap.get_urls()))
        self.assertTrue(item_in_url_info)