diff options
| author | Russell Keith-Magee <russell@keith-magee.com> | 2010-04-16 11:11:55 +0000 |
|---|---|---|
| committer | Russell Keith-Magee <russell@keith-magee.com> | 2010-04-16 11:11:55 +0000 |
| commit | 94a968cfc60e16d3fa8180ae76dce35bc931e374 (patch) | |
| tree | c38208a0208ba583f17f7585b6bcf42a32cd25c9 /tests/modeltests | |
| parent | a213599db7781c8945f161fd77e5c4b706b99853 (diff) | |
Fixed #13357 -- Minor changes to get Django running under PyPy. Thanks to Alex Gaynor for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12991 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/modeltests')
| -rw-r--r-- | tests/modeltests/aggregation/models.py | 8 | ||||
| -rw-r--r-- | tests/modeltests/expressions/models.py | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/tests/modeltests/aggregation/models.py b/tests/modeltests/aggregation/models.py index e5f0f5d318..74e43b8cc6 100644 --- a/tests/modeltests/aggregation/models.py +++ b/tests/modeltests/aggregation/models.py @@ -191,8 +191,8 @@ u'The Definitive Guide to Django: Web Development Done Right' # Calling values on a queryset that has annotations returns the output # as a dictionary ->>> Book.objects.filter(pk=1).annotate(mean_age=Avg('authors__age')).values() -[{'rating': 4.5, 'isbn': u'159059725', 'name': u'The Definitive Guide to Django: Web Development Done Right', 'pubdate': datetime.date(2007, 12, 6), 'price': Decimal("30..."), 'contact_id': 1, 'id': 1, 'publisher_id': 1, 'pages': 447, 'mean_age': 34.5}] +>>> [sorted(o.iteritems()) for o in Book.objects.filter(pk=1).annotate(mean_age=Avg('authors__age')).values()] +[[('contact_id', 1), ('id', 1), ('isbn', u'159059725'), ('mean_age', 34.5), ('name', u'The Definitive Guide to Django: Web Development Done Right'), ('pages', 447), ('price', Decimal("30...")), ('pubdate', datetime.date(2007, 12, 6)), ('publisher_id', 1), ('rating', 4.5)]] >>> Book.objects.filter(pk=1).annotate(mean_age=Avg('authors__age')).values('pk', 'isbn', 'mean_age') [{'pk': 1, 'isbn': u'159059725', 'mean_age': 34.5}] @@ -203,8 +203,8 @@ u'The Definitive Guide to Django: Web Development Done Right' # An empty values() call before annotating has the same effect as an # empty values() call after annotating ->>> Book.objects.filter(pk=1).values().annotate(mean_age=Avg('authors__age')) -[{'rating': 4.5, 'isbn': u'159059725', 'name': u'The Definitive Guide to Django: Web Development Done Right', 'pubdate': datetime.date(2007, 12, 6), 'price': Decimal("30..."), 'contact_id': 1, 'id': 1, 'publisher_id': 1, 'pages': 447, 'mean_age': 34.5}] +>>> [sorted(o.iteritems()) for o in Book.objects.filter(pk=1).values().annotate(mean_age=Avg('authors__age'))] +[[('contact_id', 1), ('id', 1), ('isbn', u'159059725'), ('mean_age', 34.5), ('name', u'The Definitive Guide to Django: Web Development Done Right'), ('pages', 447), ('price', Decimal("30...")), ('pubdate', datetime.date(2007, 12, 6)), ('publisher_id', 1), ('rating', 4.5)]] # Calling annotate() on a ValuesQuerySet annotates over the groups of # fields to be selected by the ValuesQuerySet. diff --git a/tests/modeltests/expressions/models.py b/tests/modeltests/expressions/models.py index 76006e10f0..f6292f5d9b 100644 --- a/tests/modeltests/expressions/models.py +++ b/tests/modeltests/expressions/models.py @@ -127,6 +127,6 @@ FieldError: Joined field references are not permitted in this query >>> acme.save() Traceback (most recent call last): ... -TypeError: int() argument must be a string or a number... +TypeError: ... """} |
