[Catalyst] Using test database with TWAM?
Jesse Sheidlower
jester at panix.com
Thu Apr 30 15:42:39 GMT 2009
I assume this is more of a general Perl testing question than
a Catalyst question, but....
I finally sat down to write real tests for one of my apps,
with the hopes that I'll do this regularly for everything. I
was using the Tutorial chapter on testing, and the docs for
Test::WWW::Mechanize::Catalyst, for ideas.
I quickly hit a wall because I couldn't figure out how to run
this with a test database. Since I need to test modification
and deletion stuff, but have real data, I can't just run this
against my actual app. So I figured I would dump the sql from
my production app and have my test program load this into a
database called "test-db" or whatever, having the same format
and schema as the real db, and then just drop the test db at
the end of the test.
Unfortunately I don't know how to do this from a test script,
and I don't know how to tell TWAM to run a particular app but
with a different DBIC schema (in this case, the identical one
but with a different name, pointing to the test db) instead.
Or how to do the same thing, but with TWAM hitting the app
with the external-server method (so I can test the Apache
deployment).
Would be grateful for any pointers.
Thanks.
Jesse Sheidlower
More information about the Catalyst
mailing list