mirror of
				https://github.com/django/django.git
				synced 2025-10-29 16:46:11 +00:00 
			
		
		
		
	[1.8.x] Isolated a flatpages test; refs #11505.
Backport of 4135d83702 from master
			
			
This commit is contained in:
		| @@ -1,6 +1,7 @@ | |||||||
| from __future__ import unicode_literals | from __future__ import unicode_literals | ||||||
|  |  | ||||||
| from django.apps import apps | from django.apps import apps | ||||||
|  | from django.contrib.sites.models import Site | ||||||
| from django.test import TestCase | from django.test import TestCase | ||||||
| from django.test.utils import modify_settings, override_settings | from django.test.utils import modify_settings, override_settings | ||||||
|  |  | ||||||
| @@ -12,6 +13,13 @@ from django.test.utils import modify_settings, override_settings | |||||||
| @modify_settings(INSTALLED_APPS={'append': ['django.contrib.sitemaps']},) | @modify_settings(INSTALLED_APPS={'append': ['django.contrib.sitemaps']},) | ||||||
| class FlatpagesSitemapTests(TestCase): | 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 |     @classmethod | ||||||
|     def setUpTestData(cls): |     def setUpTestData(cls): | ||||||
|         Site = apps.get_model('sites.Site') |         Site = apps.get_model('sites.Site') | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user