1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Fixed #24075 -- Used post-migration models in contrib apps receivers.

Thanks Markus and Tim for the review.
This commit is contained in:
Simon Charette
2016-05-13 11:59:27 -04:00
parent f937c9ec97
commit 61a16e0270
8 changed files with 62 additions and 59 deletions

View File

@@ -1,6 +1,7 @@
from __future__ import unicode_literals
from django.apps import apps
from django.apps.registry import Apps
from django.conf import settings
from django.contrib.sites import models
from django.contrib.sites.management import create_default_site
@@ -293,6 +294,14 @@ class CreateDefaultSiteTests(TestCase):
create_default_site(self.app_config, verbosity=0)
self.assertEqual(Site.objects.get().pk, 1)
def test_unavailable_site_model(self):
"""
#24075 - A Site shouldn't be created if the model isn't available.
"""
apps = Apps()
create_default_site(self.app_config, verbosity=0, apps=apps)
self.assertFalse(Site.objects.exists())
class MiddlewareTest(TestCase):