diff options
| author | Tom Christie | 2012-10-04 09:18:46 +0100 | 
|---|---|---|
| committer | Tom Christie | 2012-10-04 09:18:46 +0100 | 
| commit | bcd2caf5598a71cb468d86b6f286e180d1bf0a19 (patch) | |
| tree | 53bf053621a19c976486991d7d2802d69addcb78 /rest_framework/tests/models.py | |
| parent | a02707e12f750fd0d325e528f7b0fbcd7079db73 (diff) | |
| download | django-rest-framework-bcd2caf5598a71cb468d86b6f286e180d1bf0a19.tar.bz2 | |
Abstract out the app_label on test models
Diffstat (limited to 'rest_framework/tests/models.py')
| -rw-r--r-- | rest_framework/tests/models.py | 21 | 
1 files changed, 9 insertions, 12 deletions
| diff --git a/rest_framework/tests/models.py b/rest_framework/tests/models.py index c90668ca..c5636f35 100644 --- a/rest_framework/tests/models.py +++ b/rest_framework/tests/models.py @@ -28,25 +28,22 @@ from django.db import models  #             'pk': self.id  #         }) -class Anchor(models.Model): +class RestFrameworkModel(models.Model):      """ -    A simple model to use as the target of relationships for other test models. +    Base for test models that sets app_label, so they play nicely.      """ -    text = models.CharField(max_length=100, default='anchor') -      class Meta:          app_label = 'rest_framework' +        abstract = True -class BasicModel(models.Model): -    text = models.CharField(max_length=100) +class Anchor(RestFrameworkModel): +    text = models.CharField(max_length=100, default='anchor') -    class Meta: -        app_label = 'rest_framework' +class BasicModel(RestFrameworkModel): +    text = models.CharField(max_length=100) -class ManyToManyModel(models.Model): -    rel = models.ManyToManyField(Anchor) -    class Meta: -        app_label = 'rest_framework' +class ManyToManyModel(RestFrameworkModel): +    rel = models.ManyToManyField(Anchor) | 
