Loading django/contrib/sites/management.py +1 −1 Original line number Diff line number Diff line Loading @@ -17,7 +17,7 @@ def create_default_site(app_config, verbosity=2, interactive=True, using=DEFAULT if not router.allow_migrate(using, Site): return if not Site.objects.exists(): if not Site.objects.using(using).exists(): # The default settings set SITE_ID = 1, and some tests in Django's test # suite rely on this value. However, if database sequences are reused # (e.g. in the test suite after flush/syncdb), it isn't guaranteed that Loading django/contrib/sites/tests.py +8 −1 Original line number Diff line number Diff line Loading @@ -107,7 +107,7 @@ class CreateDefaultSiteTests(TestCase): self.assertEqual(Site.objects.count(), 1) @unittest.skipIf('other' not in connections, "Requires 'other' database connection.") def test_multi_db(self): def test_multi_db_with_router(self): """ #16353, #16828 - The default site creation should respect db routing. """ Loading @@ -121,6 +121,13 @@ class CreateDefaultSiteTests(TestCase): finally: router.routers = old_routers @unittest.skipIf('other' not in connections, "Requires 'other' database connection.") def test_multi_db(self): create_default_site(self.app_config, using='default', verbosity=0) create_default_site(self.app_config, using='other', verbosity=0) self.assertTrue(Site.objects.using('default').exists()) self.assertTrue(Site.objects.using('other').exists()) def test_save_another(self): """ #17415 - Another site can be created right after the default one. Loading docs/releases/1.7.5.txt +3 −0 Original line number Diff line number Diff line Loading @@ -16,3 +16,6 @@ Bugfixes * Fixed a regression that prevented custom fields inheriting from ``ManyToManyField`` from being recognized in migrations (:ticket:`24236`). * Fixed crash in ``contrib.sites`` migrations when a default database isn't used (:ticket:`24332`). Loading
django/contrib/sites/management.py +1 −1 Original line number Diff line number Diff line Loading @@ -17,7 +17,7 @@ def create_default_site(app_config, verbosity=2, interactive=True, using=DEFAULT if not router.allow_migrate(using, Site): return if not Site.objects.exists(): if not Site.objects.using(using).exists(): # The default settings set SITE_ID = 1, and some tests in Django's test # suite rely on this value. However, if database sequences are reused # (e.g. in the test suite after flush/syncdb), it isn't guaranteed that Loading
django/contrib/sites/tests.py +8 −1 Original line number Diff line number Diff line Loading @@ -107,7 +107,7 @@ class CreateDefaultSiteTests(TestCase): self.assertEqual(Site.objects.count(), 1) @unittest.skipIf('other' not in connections, "Requires 'other' database connection.") def test_multi_db(self): def test_multi_db_with_router(self): """ #16353, #16828 - The default site creation should respect db routing. """ Loading @@ -121,6 +121,13 @@ class CreateDefaultSiteTests(TestCase): finally: router.routers = old_routers @unittest.skipIf('other' not in connections, "Requires 'other' database connection.") def test_multi_db(self): create_default_site(self.app_config, using='default', verbosity=0) create_default_site(self.app_config, using='other', verbosity=0) self.assertTrue(Site.objects.using('default').exists()) self.assertTrue(Site.objects.using('other').exists()) def test_save_another(self): """ #17415 - Another site can be created right after the default one. Loading
docs/releases/1.7.5.txt +3 −0 Original line number Diff line number Diff line Loading @@ -16,3 +16,6 @@ Bugfixes * Fixed a regression that prevented custom fields inheriting from ``ManyToManyField`` from being recognized in migrations (:ticket:`24236`). * Fixed crash in ``contrib.sites`` migrations when a default database isn't used (:ticket:`24332`).