Testing purists and fans of Cake Pattern probably won't like this answer, but we run into the same problem you do and do the following:
We use the database defaultto run the application (when testing on production systems), but for automatic tests (using play test) we use a separate testdb configuration , which has its own evolutions, and runs on H2 instead of PostgreSQL.
On Play, you can check if the test mode is currently running, and you can modify the database accordingly:
lazy val default = Database.forDataSource {
val defaultSource = current.configuration.getString("db.test.url").fold("default")(_ => "test")
new play.api.db.DB.getDataSource(defaultSource)
}
Having separate evolutions for automated tests, there are other advantages: you can populate the database with some basic test data that may differ from other test systems.
, .