osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Best way to (re)load test data in Mongo DB


breamoreboy at gmail.com writes:
> I was going to suggest mocking. I'm no expert so I suggest that you
> search for "python test mock database" and go from there. Try to run
> tests with a real db and you're likely to be at it until domesday.

Mocking is definitely the order of the day for most tests, but I'd like
to test the data layer itself, too, and I want a number of comprehensive
function tests as well, and these need to exercise the whole stack.
Mocking is great so long as you also remember to test the things that
you mock.

The point of this exercise is to eventually release it as a sort of
example project of how to build a complex web application. Testing is
particularly important to me since it's too often being overlooked in
tutorials, or it only deals with trivial examples.


Martin