Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[py3k] Fixed pagination_regress tests.

  • Loading branch information...
commit 37a894b48c857d89820e6e8f90436422a075f7ad 1 parent d69bd23
Alex Gaynor authored
Showing with 4 additions and 2 deletions.
  1. +4 −2 tests/regressiontests/pagination_regress/tests.py
6 tests/regressiontests/pagination_regress/tests.py
View
@@ -17,14 +17,16 @@ def check_paginator(self, params, output):
paginator = Paginator(*params)
self.check_attribute('count', paginator, count, params)
self.check_attribute('num_pages', paginator, num_pages, params)
- self.check_attribute('page_range', paginator, page_range, params)
+ self.check_attribute('page_range', paginator, page_range, params, coerce=list)
- def check_attribute(self, name, paginator, expected, params):
+ def check_attribute(self, name, paginator, expected, params, coerce=None):
"""
Helper method that checks a single attribute and gives a nice error
message upon test failure.
"""
got = getattr(paginator, name)
+ if coerce is not None:
+ got = coerce(got)
self.assertEqual(expected, got,
"For '%s', expected %s but got %s. Paginator parameters were: %s"
% (name, expected, got, params))
Please sign in to comment.
Something went wrong with that request. Please try again.