summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2015-01-22 15:23:45 -0500
committerTim Graham <timograham@gmail.com>2015-01-22 15:50:26 -0500
commit1806e059f6127e3e4572db09f297984c96ea9d02 (patch)
treee1f939d656410505e7ccd013d4c9e41166176969
parent11a5e45b96c3a15826927f5d0e50472767b937f1 (diff)
[1.8.x] Isolated a flatpages test; refs #11505.
Backport of 4135d837027eac43ec416856d9476c478167d8a6 from master
-rw-r--r--django/contrib/flatpages/tests/test_sitemaps.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/django/contrib/flatpages/tests/test_sitemaps.py b/django/contrib/flatpages/tests/test_sitemaps.py
index 3b8e57d174..dcfbef4e29 100644
--- a/django/contrib/flatpages/tests/test_sitemaps.py
+++ b/django/contrib/flatpages/tests/test_sitemaps.py
@@ -1,6 +1,7 @@
from __future__ import unicode_literals
from django.apps import apps
+from django.contrib.sites.models import Site
from django.test import TestCase
from django.test.utils import modify_settings, override_settings
@@ -13,6 +14,13 @@ from django.test.utils import modify_settings, override_settings
class FlatpagesSitemapTests(TestCase):
@classmethod
+ def setUpClass(cls):
+ super(FlatpagesSitemapTests, cls).setUpClass()
+ # This cleanup is necessary because contrib.sites cache
+ # makes tests interfere with each other, see #11505
+ Site.objects.clear_cache()
+
+ @classmethod
def setUpTestData(cls):
Site = apps.get_model('sites.Site')
current_site = Site.objects.get_current()