mirror of
				https://github.com/django/django.git
				synced 2025-11-04 13:39:16 +00:00 
			
		
		
		
	Fixed #23850 -- Fixed a migrations test failure on Mac OS X & Python 3
This commit is contained in:
		
							parent
							
								
									39b58ad95a
								
							
						
					
					
						commit
						faf0d66a80
					
				
					 1 changed files with 6 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -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")
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue