Make sure the database name and host are dynamic

Previously they were hard-coded, which made the tests basically useless.