diff options
author | Aymeric Augustin <aymeric.augustin@m4x.org> | 2014-01-05 10:13:10 +0100 |
---|---|---|
committer | Aymeric Augustin <aymeric.augustin@m4x.org> | 2014-01-05 20:52:46 +0100 |
commit | d4b059d3eb2850f43a06162c8316777cb1681d7b (patch) | |
tree | 98d2ee04b66227c0724f42faebb807dbe993eb53 /tests/app_loading | |
parent | a7588e2e220bab47bf18601b173d6bfd429f5931 (diff) | |
download | django-d4b059d3eb2850f43a06162c8316777cb1681d7b.tar.gz |
Fixed test for models in non-installed apps.
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.
Diffstat (limited to 'tests/app_loading')
-rw-r--r-- | tests/app_loading/not_installed/models.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/app_loading/not_installed/models.py b/tests/app_loading/not_installed/models.py index 1e4b59894c..09cf2ac6ed 100644 --- a/tests/app_loading/not_installed/models.py +++ b/tests/app_loading/not_installed/models.py @@ -2,12 +2,22 @@ from django.db import models class NotInstalledModel(models.Model): - pass + + 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) |