Skip to content

Commit 4135d83

Browse files
committed
Isolated a flatpages test; refs django#11505.
1 parent 4669b6a commit 4135d83

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

django/contrib/flatpages/tests/test_sitemaps.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from __future__ import unicode_literals
22

33
from django.apps import apps
4+
from django.contrib.sites.models import Site
45
from django.test import TestCase
56
from django.test.utils import modify_settings, override_settings
67

@@ -12,6 +13,13 @@
1213
@modify_settings(INSTALLED_APPS={'append': ['django.contrib.sitemaps']},)
1314
class FlatpagesSitemapTests(TestCase):
1415

16+
@classmethod
17+
def setUpClass(cls):
18+
super(FlatpagesSitemapTests, cls).setUpClass()
19+
# This cleanup is necessary because contrib.sites cache
20+
# makes tests interfere with each other, see #11505
21+
Site.objects.clear_cache()
22+
1523
@classmethod
1624
def setUpTestData(cls):
1725
Site = apps.get_model('sites.Site')

0 commit comments

Comments
 (0)