[TIP] Testing with Databases

Alfredo Deza alfredodeza at gmail.com
Sun Jul 18 12:08:09 PDT 2010


Hi,

I am building test cases for a middleware app that uses a database to store
some data.

Although I am using MongoDB, my question should be regardless of the
database being used.

What would you guys recommend to correctly test database behavior related to
my application?

Should I rely on expecting a working database when the application is
installed?

Is it OK to mock MongoDB? (or any other DB being used). I know mocking is OK
but might get brittle
tests if it gets overused.

Maybe even a combination of both: mock some parts but still have certain
tests that will definitely require
an instance of the database running which could potentially prevent version
changes that break the app.

Any recommendations as to how to deal with database functionality testing
would be great.


Thanks!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.idyll.org/pipermail/testing-in-python/attachments/20100718/efe11a60/attachment.html>


More information about the testing-in-python mailing list