forked from django/django
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moved contrib.sitemaps tests out of contrib.
- Loading branch information
Showing
13 changed files
with
43 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from django.core.urlresolvers import reverse | ||
from django.db import models | ||
|
||
|
||
class TestModel(models.Model): | ||
name = models.CharField(max_length=100) | ||
|
||
def get_absolute_url(self): | ||
return '/testmodel/%s/' % self.id | ||
|
||
|
||
class I18nTestModel(models.Model): | ||
name = models.CharField(max_length=100) | ||
|
||
def get_absolute_url(self): | ||
return reverse('i18n_testmodel', args=[self.id]) |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.