[Catalyst] Using Test::WWW::Mechanize::Catalyst on a test database

Robert Rothenberg robrwo at gmail.com
Wed Feb 15 15:25:51 GMT 2012


I would like to use Test::WWW::Mechanize::Catalyst with an alternative
database schema (since I want to test reading and writing on a database with
the same schema but known data that is not the live database), but it's not
clear to me from reading the documentation on how to do this, or even if
it's possible.

I've found examples using Catalyst::Test with DBICx::TestDatabase, but I
cannot get it to work. The line

  $c->model('DBIC')->schema($schema);

fails with

  Can't call method "schema" on an undefined value...

Worse, the application uses some PostgreSQL extensions, so
DBICx::TestDatabase is not appropriate.

I am looking into Test::DBIx::Class as an alternative, but again, it's still
not clear how to change the database that Test::WWW::Mechanize uses.

Regards,
Rob



More information about the Catalyst mailing list