mirror of
				https://github.com/django/django.git
				synced 2025-10-27 07:36:08 +00:00 
			
		
		
		
	Models are now attached to any application they're defined in. Since not_installed was inside app_loading, these models were mistakenly attached to app_loading. The test that used them passed accidentally when run after EggLoadingTest because that class' tearDown() method replaces apps.all_models['app_loading'] by a copy of itself, while it should remain the same as apps.app_configs['app_loading'].models.
		
			
				
	
	
		
			24 lines
		
	
	
		
			425 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			24 lines
		
	
	
		
			425 B
		
	
	
	
		
			Python
		
	
	
	
	
	
| from django.db import models
 | |
| 
 | |
| 
 | |
| class NotInstalledModel(models.Model):
 | |
| 
 | |
|     class Meta:
 | |
|         app_label = 'not_installed'
 | |
| 
 | |
| 
 | |
| class RelatedModel(models.Model):
 | |
| 
 | |
|     class Meta:
 | |
|         app_label = 'not_installed'
 | |
| 
 | |
|     not_installed = models.ForeignKey(NotInstalledModel)
 | |
| 
 | |
| 
 | |
| class M2MRelatedModel(models.Model):
 | |
| 
 | |
|     class Meta:
 | |
|         app_label = 'not_installed'
 | |
| 
 | |
|     not_installed = models.ManyToManyField(NotInstalledModel)
 |