aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/tests/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'rest_framework/tests/models.py')
-rw-r--r--rest_framework/tests/models.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/rest_framework/tests/models.py b/rest_framework/tests/models.py
index 6cc2c311..969c8297 100644
--- a/rest_framework/tests/models.py
+++ b/rest_framework/tests/models.py
@@ -28,6 +28,10 @@ from django.db import models
# 'pk': self.id
# })
+def foobar():
+ return 'foobar'
+
+
class RESTFrameworkModel(models.Model):
"""
Base for test models that sets app_label, so they play nicely.
@@ -45,5 +49,13 @@ class BasicModel(RESTFrameworkModel):
text = models.CharField(max_length=100)
+class DefaultValueModel(RESTFrameworkModel):
+ text = models.CharField(default='foobar', max_length=100)
+
+
+class CallableDefaultValueModel(RESTFrameworkModel):
+ text = models.CharField(default=foobar, max_length=100)
+
+
class ManyToManyModel(RESTFrameworkModel):
rel = models.ManyToManyField(Anchor)