diff options
author | coderick14 | 2017-05-17 15:40:18 +0530 |
---|---|---|
committer | coderick14 | 2017-05-17 15:41:00 +0530 |
commit | a1e0a5502f04da68b6a9ca8508dda3f9d7e1d055 (patch) | |
tree | 20181e6b1936f50ad48d8e35720d64a37566f558 /lib/python2.7/site-packages/django/contrib/sitemaps/tests/test_flatpages.py | |
parent | 6f4a84c1e58ff4d54aab94cbee26e995328b05b8 (diff) | |
download | SBHS-2018-Rpi-a1e0a5502f04da68b6a9ca8508dda3f9d7e1d055.tar.gz SBHS-2018-Rpi-a1e0a5502f04da68b6a9ca8508dda3f9d7e1d055.tar.bz2 SBHS-2018-Rpi-a1e0a5502f04da68b6a9ca8508dda3f9d7e1d055.zip |
Upgrade to Django 1.11
- Database integration yet to be tested
Diffstat (limited to 'lib/python2.7/site-packages/django/contrib/sitemaps/tests/test_flatpages.py')
-rw-r--r-- | lib/python2.7/site-packages/django/contrib/sitemaps/tests/test_flatpages.py | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/lib/python2.7/site-packages/django/contrib/sitemaps/tests/test_flatpages.py b/lib/python2.7/site-packages/django/contrib/sitemaps/tests/test_flatpages.py deleted file mode 100644 index 930f24f..0000000 --- a/lib/python2.7/site-packages/django/contrib/sitemaps/tests/test_flatpages.py +++ /dev/null @@ -1,39 +0,0 @@ -from __future__ import unicode_literals - -from django.conf import settings -from django.utils.unittest import skipUnless - -from .base import SitemapTestsBase - -class FlatpagesSitemapTests(SitemapTestsBase): - - @skipUnless("django.contrib.flatpages" in settings.INSTALLED_APPS, - "django.contrib.flatpages app not installed.") - def test_flatpage_sitemap(self): - "Basic FlatPage sitemap test" - - # Import FlatPage inside the test so that when django.contrib.flatpages - # is not installed we don't get problems trying to delete Site - # objects (FlatPage has an M2M to Site, Site.delete() tries to - # delete related objects, but the M2M table doesn't exist. - from django.contrib.flatpages.models import FlatPage - - public = FlatPage.objects.create( - url='/public/', - title='Public Page', - enable_comments=True, - registration_required=False, - ) - public.sites.add(settings.SITE_ID) - private = FlatPage.objects.create( - url='/private/', - title='Private Page', - enable_comments=True, - registration_required=True - ) - private.sites.add(settings.SITE_ID) - response = self.client.get('/flatpages/sitemap.xml') - # Public flatpage should be in the sitemap - self.assertContains(response, '<loc>%s%s</loc>' % (self.base_url, public.url)) - # Private flatpage should not be in the sitemap - self.assertNotContains(response, '<loc>%s%s</loc>' % (self.base_url, private.url)) |