aboutsummaryrefslogtreecommitdiffstats
path: root/src/shorturls/tests/models.py
diff options
context:
space:
mode:
authorJacob Kaplan-Moss2009-04-12 16:25:05 -0500
committerJacob Kaplan-Moss2009-04-12 16:25:05 -0500
commitb5ee253b28673fcfad49f09d9d2687e86ed520b7 (patch)
tree32f3f5939bf8d69503f443573414ea80567d095e /src/shorturls/tests/models.py
parent4391a39ee4cde31ff9c9a56cd8d452b934136b4e (diff)
downloaddjango-shorturls-b5ee253b28673fcfad49f09d9d2687e86ed520b7.tar.bz2
Added a working shorturl redirect view, with tests.
Diffstat (limited to 'src/shorturls/tests/models.py')
-rw-r--r--src/shorturls/tests/models.py37
1 files changed, 36 insertions, 1 deletions
diff --git a/src/shorturls/tests/models.py b/src/shorturls/tests/models.py
index f521e56..5416b17 100644
--- a/src/shorturls/tests/models.py
+++ b/src/shorturls/tests/models.py
@@ -1,3 +1,38 @@
"""
A handful of test modules to test out resolving redirects.
-""" \ No newline at end of file
+"""
+
+from django.db import models
+
+class Animal(models.Model):
+ name = models.CharField(max_length=100)
+
+ class Meta:
+ app_label = 'shorturls'
+
+ def __unicode__(self):
+ return self.name
+
+ def get_absolute_url(self):
+ return '/animal/%s/' % self.id
+
+class Vegetable(models.Model):
+ name = models.CharField(max_length=100)
+
+ class Meta:
+ app_label = 'shorturls'
+
+ def __unicode__(self):
+ return self.name
+
+ def get_absolute_url(self):
+ return 'http://example.net/veggies/%s' % self.id
+
+class Mineral(models.Model):
+ name = models.CharField(max_length=100)
+
+ class Meta:
+ app_label = 'shorturls'
+
+ def __unicode__(self):
+ return self.name \ No newline at end of file