summaryrefslogtreecommitdiff
path: root/tests/modeltests/custom_columns/models.py
diff options
context:
space:
mode:
authorAdrian Holovaty <adrian@holovaty.com>2006-06-04 00:23:51 +0000
committerAdrian Holovaty <adrian@holovaty.com>2006-06-04 00:23:51 +0000
commita5b7c298164e3c1547988c734d6155c17f57b1d7 (patch)
treeea42bc0b63aaf2db9600fa2546b98807bdee4f90 /tests/modeltests/custom_columns/models.py
parent55e453a09c071cd34962d5b809121aa17241aaae (diff)
Changed all model unit tests to use __str__() instead of __repr__(). Also slightly changed related-object DoesNotExist exception message to use repr instead of str
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3075 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/modeltests/custom_columns/models.py')
-rw-r--r--tests/modeltests/custom_columns/models.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/modeltests/custom_columns/models.py b/tests/modeltests/custom_columns/models.py
index 4958517e69..7d8c52d137 100644
--- a/tests/modeltests/custom_columns/models.py
+++ b/tests/modeltests/custom_columns/models.py
@@ -12,7 +12,7 @@ class Person(models.Model):
first_name = models.CharField(maxlength=30, db_column='firstname')
last_name = models.CharField(maxlength=30, db_column='last')
- def __repr__(self):
+ def __str__(self):
return '%s %s' % (self.first_name, self.last_name)
API_TESTS = """
@@ -24,13 +24,13 @@ API_TESTS = """
1
>>> Person.objects.all()
-[John Smith]
+[<Person: John Smith>]
>>> Person.objects.filter(first_name__exact='John')
-[John Smith]
+[<Person: John Smith>]
>>> Person.objects.get(first_name__exact='John')
-John Smith
+<Person: John Smith>
>>> Person.objects.filter(firstname__exact='John')
Traceback (most recent call last):