mirror of
				https://github.com/django/django.git
				synced 2025-10-31 09:41:08 +00:00 
			
		
		
		
	Fixed #23850 -- Fixed a migrations test failure on Mac OS X & Python 3
This commit is contained in:
		
				
					committed by
					
						 Tim Graham
						Tim Graham
					
				
			
			
				
	
			
			
			
						parent
						
							39b58ad95a
						
					
				
				
					commit
					faf0d66a80
				
			| @@ -2,6 +2,7 @@ | ||||
| from __future__ import unicode_literals | ||||
|  | ||||
| import codecs | ||||
| import importlib | ||||
| import os | ||||
| import shutil | ||||
|  | ||||
| @@ -686,6 +687,11 @@ class MakeMigrationsTests(MigrationTestBase): | ||||
|         content = cmd("0001", migration_name_0001) | ||||
|         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 | ||||
|         migration_name_0002 = "my_custom_migration" | ||||
|         content = cmd("0002", migration_name_0002, "--empty") | ||||
|   | ||||
		Reference in New Issue
	
	Block a user