Skip to content

Commit

Permalink
Fixed test for models in non-installed apps.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
aaugustin committed Jan 5, 2014
1 parent a7588e2 commit d4b059d
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion tests/app_loading/not_installed/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,22 @@


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)

0 comments on commit d4b059d

Please sign in to comment.