Using the test client API for integration tests?

1 view
Skip to first unread message

Yoz Grahame

unread,
Jul 2, 2009, 3:17:31 PM7/2/09
to Django users
At my company we're already successfully using the test client API for
our unit tests. However, we'd like to use those same tests for
integration tests in staging - i.e. making full HTTP calls over
sockets through our full LB + Apache + mod_wsgi setup.

Does anyone know of a client lib that exposes the same interface as
the Django test client (so that we can keep using those same tests for
local in-process testing) but talks full HTTP?

-- Yoz

Alex Gaynor

unread,
Jul 2, 2009, 3:22:48 PM7/2/09
to django...@googlegroups.com
Check out httplib2, it's the most popular library for making HTTP requests in Python (there are like 3 seperate modules in the stdlib you can use for it also, urllib, urllib2, and httplib, but I think httplib2 is best).

Alex

--
"I disapprove of what you say, but I will defend to the death your right to say it." --Voltaire
"The people's good is the highest law."--Cicero

Yoz Grahame

unread,
Jul 2, 2009, 3:41:56 PM7/2/09
to Django users

On Jul 2, 12:22 pm, Alex Gaynor <alex.gay...@gmail.com> wrote:
> On Thu, Jul 2, 2009 at 2:17 PM, Yoz Grahame <yoz...@gmail.com> wrote:
>
> Check out httplib2, it's the most popular library for making HTTP requests
> in Python (there are like 3 seperate modules in the stdlib you can use for
> it also, urllib, urllib2, and httplib, but I think httplib2 is best).

Yeah, I've been looking at httplib2 for this, with a view to wrapping
it in a proxy that provides the Django test client interface. Just
wondering if someone else has done that already.

-- Yoz
Reply all
Reply to author
Forward
0 new messages