diff options
author | Simon Charette <charette.s@gmail.com> | 2016-05-13 11:59:27 -0400 |
---|---|---|
committer | Simon Charette <charette.s@gmail.com> | 2016-05-15 19:51:16 -0400 |
commit | 61a16e02702fff4665969388f3b61af8cb1a20ae (patch) | |
tree | 5dbc9b622e5e1e37fb1d02943b3ec56c76b08235 /tests/sites_tests | |
parent | f937c9ec975ebd719f0c22e5d1d5f5fb87ff1edd (diff) | |
download | django-61a16e02702fff4665969388f3b61af8cb1a20ae.tar.gz |
Fixed #24075 -- Used post-migration models in contrib apps receivers.
Thanks Markus and Tim for the review.
Diffstat (limited to 'tests/sites_tests')
-rw-r--r-- | tests/sites_tests/tests.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/sites_tests/tests.py b/tests/sites_tests/tests.py index 3cbd6af2ee..fa618b4acc 100644 --- a/tests/sites_tests/tests.py +++ b/tests/sites_tests/tests.py @@ -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): |