summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMarten Kenbeek <marten.knbk@gmail.com>2015-02-16 14:02:49 +0100
committerTim Graham <timograham@gmail.com>2015-02-16 08:43:06 -0500
commitbc2eb6bfef00fd8ea4395e3462366b6571f88601 (patch)
tree33266c4bb30770baab9fe34d3b4c5070bf810ad3 /tests
parentba9f60270887ae21424683c53bced3c226d5fa39 (diff)
[1.8.x] Fixed #24345 -- Isolated sitemaps_tests from contenttypes_tests; refs #11505
Backport of f668bac9d223408627ca92b2281cf7110039510b from master
Diffstat (limited to 'tests')
-rw-r--r--tests/sitemaps_tests/base.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/sitemaps_tests/base.py b/tests/sitemaps_tests/base.py
index c3476cf08e..473ced7d3a 100644
--- a/tests/sitemaps_tests/base.py
+++ b/tests/sitemaps_tests/base.py
@@ -1,4 +1,5 @@
from django.apps import apps
+from django.contrib.sites.models import Site
from django.core.cache import cache
from django.test import TestCase, modify_settings, override_settings
@@ -18,3 +19,10 @@ class SitemapTestsBase(TestCase):
# Create an object for sitemap content.
TestModel.objects.create(name='Test Object')
self.i18n_model = I18nTestModel.objects.create(name='Test Object')
+
+ @classmethod
+ def setUpClass(cls):
+ super(SitemapTestsBase, cls).setUpClass()
+ # This cleanup is necessary because contrib.sites cache
+ # makes tests interfere with each other, see #11505
+ Site.objects.clear_cache()