#15346, #15573 - create_default_site() creates an example site only if none exist.
(self)
| 277 | self.app_config = apps.get_app_config("sites") |
| 278 | |
| 279 | def test_basic(self): |
| 280 | """ |
| 281 | #15346, #15573 - create_default_site() creates an example site only if |
| 282 | none exist. |
| 283 | """ |
| 284 | with captured_stdout() as stdout: |
| 285 | create_default_site(self.app_config) |
| 286 | self.assertEqual(Site.objects.count(), 1) |
| 287 | self.assertIn("Creating example.com", stdout.getvalue()) |
| 288 | |
| 289 | with captured_stdout() as stdout: |
| 290 | create_default_site(self.app_config) |
| 291 | self.assertEqual(Site.objects.count(), 1) |
| 292 | self.assertEqual("", stdout.getvalue()) |
| 293 | |
| 294 | @override_settings(DATABASE_ROUTERS=[JustOtherRouter()]) |
| 295 | def test_multi_db_with_router(self): |
nothing calls this directly
no test coverage detected