1
0
mirror of https://github.com/django/django.git synced 2025-10-24 22:26:08 +00:00

Moved contrib.sitemaps tests out of contrib.

This commit is contained in:
Tim Graham
2015-02-10 08:11:25 -05:00
parent d8341bf024
commit fbc467c26b
13 changed files with 43 additions and 47 deletions

View File

@@ -0,0 +1,20 @@
from django.apps import apps
from django.core.cache import cache
from django.test import TestCase, modify_settings, override_settings
from .models import I18nTestModel, TestModel
@modify_settings(INSTALLED_APPS={'append': 'django.contrib.sitemaps'})
@override_settings(ROOT_URLCONF='sitemaps_tests.urls.http')
class SitemapTestsBase(TestCase):
protocol = 'http'
sites_installed = apps.is_installed('django.contrib.sites')
domain = 'example.com' if sites_installed else 'testserver'
def setUp(self):
self.base_url = '%s://%s' % (self.protocol, self.domain)
cache.clear()
# Create an object for sitemap content.
TestModel.objects.create(name='Test Object')
self.i18n_model = I18nTestModel.objects.create(name='Test Object')