diff --git a/tests/migrations/migrations_test_apps/invisible_migration_error/__init__.py b/tests/migrations/migrations_test_apps/invisible_migration_error/__init__.py
new file mode 100644
index 0000000..45c1f86
-
|
+
|
|
| 1 | from __future__ import absolute_import |
| 2 | from .models import Author |
| 3 | |
| 4 | default_app_config = 'migrations.migrations_test_apps.invisible_migration_error.apps.DemoConfig' |
diff --git a/tests/migrations/migrations_test_apps/invisible_migration_error/apps.py b/tests/migrations/migrations_test_apps/invisible_migration_error/apps.py
new file mode 100644
index 0000000..166b4c8
-
|
+
|
|
| 1 | from __future__ import absolute_import |
| 2 | |
| 3 | from django.apps import AppConfig |
| 4 | |
| 5 | |
| 6 | class DemoConfig(AppConfig): |
| 7 | name = "migrations.migrations_test_apps.invisible_migration_error" |
| 8 | label = 'custom_demo' |
| 9 | verbose_name = "demo" |
diff --git a/tests/migrations/migrations_test_apps/invisible_migration_error/migrations/__init__.py b/tests/migrations/migrations_test_apps/invisible_migration_error/migrations/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/tests/migrations/migrations_test_apps/invisible_migration_error/models.py b/tests/migrations/migrations_test_apps/invisible_migration_error/models.py
new file mode 100644
index 0000000..12bd797
-
|
+
|
|
| 1 | from django.db import models |
| 2 | |
| 3 | |
| 4 | class Author(models.Model): |
| 5 | name = models.CharField(max_length=255) |
diff --git a/tests/migrations/test_commands.py b/tests/migrations/test_commands.py
index 2090135..54c1995 100644
a
|
b
|
class MakeMigrationsTests(MigrationTestBase):
|
539 | 539 | questioner.input = old_input |
540 | 540 | if os.path.exists(merge_file): |
541 | 541 | os.remove(merge_file) |
| 542 | |
| 543 | @override_system_checks([]) |
| 544 | @override_settings( |
| 545 | INSTALLED_APPS=[ |
| 546 | "migrations.migrations_test_apps.invisible_migration_error", ]) |
| 547 | def test_makemigrations_ticket_23305(self): |
| 548 | stdout = six.StringIO() |
| 549 | call_command("makemigrations", stdout=stdout) |
| 550 | initial_file = os.path.join(self.test_dir, "migrations_test_apps", |
| 551 | "invisible_migration_error", "migrations", "0001_initial.py") |
| 552 | file_exists = os.path.exists(initial_file) |
| 553 | try: |
| 554 | # Cleanup |
| 555 | os.remove(initial_file) |
| 556 | except: |
| 557 | pass |
| 558 | self.assertNotIn("No changes detected", stdout.getvalue()) |
| 559 | # Check for existing 0001_initial.py file in migration folder |
| 560 | self.assertTrue(file_exists) |