A database is not simply a bag of bits. It has behaviour which matters to the rest of the program.
That's certainly true, but in a typical web application it's quite common that the specific behaviour of a given database isn't interesting enough to warrant testing so rigorously. In those cases, integrating with the database is perhaps a less sensible choice economically.