diff --git a/tests/migrations/test_loader.py b/tests/migrations/test_loader.py index dcb6404818b..71d3c9ca369 100644 --- a/tests/migrations/test_loader.py +++ b/tests/migrations/test_loader.py @@ -521,7 +521,12 @@ class PycLoaderTests(MigrationTestBase): MigrationLoader reraises ImportErrors caused by "bad magic number" pyc files with a more helpful message. """ - with self.temporary_migration_module(module='migrations.test_migrations_bad_pyc'): + with self.temporary_migration_module(module='migrations.test_migrations_bad_pyc') as migration_dir: + # The -tpl suffix is to avoid the pyc exclusion in MANIFEST.in. + os.rename( + os.path.join(migration_dir, '0001_initial.pyc-tpl'), + os.path.join(migration_dir, '0001_initial.pyc'), + ) msg = ( r"Couldn't import '\w+.migrations.0001_initial' as it appears " "to be a stale .pyc file." diff --git a/tests/migrations/test_migrations_bad_pyc/0001_initial.pyc b/tests/migrations/test_migrations_bad_pyc/0001_initial.pyc-tpl similarity index 100% rename from tests/migrations/test_migrations_bad_pyc/0001_initial.pyc rename to tests/migrations/test_migrations_bad_pyc/0001_initial.pyc-tpl