There was an error while loading. Please reload this page.
1 parent 4669b6a commit 4135d83Copy full SHA for 4135d83
django/contrib/flatpages/tests/test_sitemaps.py
@@ -1,6 +1,7 @@
1
from __future__ import unicode_literals
2
3
from django.apps import apps
4
+from django.contrib.sites.models import Site
5
from django.test import TestCase
6
from django.test.utils import modify_settings, override_settings
7
@@ -12,6 +13,13 @@
12
13
@modify_settings(INSTALLED_APPS={'append': ['django.contrib.sitemaps']},)
14
class FlatpagesSitemapTests(TestCase):
15
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
+
23
@classmethod
24
def setUpTestData(cls):
25
Site = apps.get_model('sites.Site')
0 commit comments