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

Fixed #29749 -- Made the migrations loader ignore files starting with a tilde or underscore.

Regression in 29150d5da8.
This commit is contained in:
Tim Graham
2018-09-11 12:51:11 -04:00
committed by GitHub
parent a4d8e412e0
commit 32fbccab40
8 changed files with 20 additions and 1 deletions

View File

@@ -500,6 +500,14 @@ class LoaderTests(TestCase):
}
self.assertEqual(plan, expected_plan)
@override_settings(MIGRATION_MODULES={'migrations': 'migrations.test_migrations_private'})
def test_ignore_files(self):
"""Files prefixed with underscore, tilde, or dot aren't loaded."""
loader = MigrationLoader(connection)
loader.load_disk()
migrations = [name for app, name in loader.disk_migrations if app == 'migrations']
self.assertEqual(migrations, ['0001_initial'])
class PycLoaderTests(MigrationTestBase):