Tests for generic views' pagination

0 views
Skip to first unread message

Julien Phalip

unread,
Jul 6, 2010, 1:43:15 AM7/6/10
to Django developers
Hi,

I'm starting to work on ticket #2367 ("Pagination for date based
generic views" - http://code.djangoproject.com/ticket/2367) and I'm
looking into the object_list generic view as a reference.

For the life of me I cannot find any tests for object_list's
pagination. Am I missing something or are there really no tests for
this yet?

Many thanks.

Kind regards,

Julien

Russell Keith-Magee

unread,
Jul 6, 2010, 3:54:02 AM7/6/10
to django-d...@googlegroups.com

It looks like you may be correct. The generic view tests are all under
regressiontests/views; there are tests for object_detail, but I not
for object_list. Paginators are tested in modeltests/pagination and
regressiontests/pagination_regress, but there's no specific tests for
the object_list.

Feel free to rectify this omission :-)

Yours,
Russ Magee %-)

Julien Phalip

unread,
Jul 6, 2010, 4:36:01 AM7/6/10
to Django developers
On Jul 6, 5:54 pm, Russell Keith-Magee <russ...@keith-magee.com>
wrote:
> On Tue, Jul 6, 2010 at 1:43 PM, Julien Phalip <jpha...@gmail.com> wrote:
> > Hi,
>
> > I'm starting to work on ticket #2367 ("Pagination for date based
> > generic views" -http://code.djangoproject.com/ticket/2367) and I'm
> > looking into the object_list generic view as a reference.
>
> > For the life of me I cannot find any tests for object_list's
> > pagination. Am I missing something or are there really no tests for
> > this yet?
>
> It looks like you may be correct. The generic view tests are all under
> regressiontests/views; there are tests for object_detail, but I not
> for object_list. Paginators are tested in modeltests/pagination and
> regressiontests/pagination_regress, but there's no specific tests for
> the object_list.
>
> Feel free to rectify this omission :-)

Glad to hear I didn't go insane! :)

I've created a new ticket for the record: http://code.djangoproject.com/ticket/13897

I'm happy to take a look at it. Off the top of your head, is there
some existing testing code that I could plug into or reuse for this?

Cheers,

Julien

Russell Keith-Magee

unread,
Jul 6, 2010, 7:24:02 AM7/6/10
to django-d...@googlegroups.com

Nothing beyond the tests that already exist in regressiontests/views.
You might be able to reuse some of the models and url framework for
the date-based and object_detail view tests.

Yours,
Russ Magee %-)

Reply all
Reply to author
Forward
0 new messages