mirror of
https://github.com/django/django.git
synced 2025-04-26 02:04:38 +00:00
Fixed #23850 -- Fixed a migrations test failure on Mac OS X & Python 3
This commit is contained in:
parent
39b58ad95a
commit
faf0d66a80
@ -2,6 +2,7 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
import codecs
|
import codecs
|
||||||
|
import importlib
|
||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
|
|
||||||
@ -686,6 +687,11 @@ class MakeMigrationsTests(MigrationTestBase):
|
|||||||
content = cmd("0001", migration_name_0001)
|
content = cmd("0001", migration_name_0001)
|
||||||
self.assertIn("dependencies=[\n]", content)
|
self.assertIn("dependencies=[\n]", content)
|
||||||
|
|
||||||
|
# Python 3.3+ importlib caches os.listdir() on some platforms like
|
||||||
|
# Mac OS X (#23850).
|
||||||
|
if hasattr(importlib, 'invalidate_caches'):
|
||||||
|
importlib.invalidate_caches()
|
||||||
|
|
||||||
# generate an empty migration
|
# generate an empty migration
|
||||||
migration_name_0002 = "my_custom_migration"
|
migration_name_0002 = "my_custom_migration"
|
||||||
content = cmd("0002", migration_name_0002, "--empty")
|
content = cmd("0002", migration_name_0002, "--empty")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user