views:

40

answers:

2

Hi overflowed. I'am wondering, how to write integration tests, that involves DB interaction, for Google app engine?

It's seems - no problem to run this test at Google, on "live" db, using GAEUnit SO Thread But, this seems bad practice to me, because it's live environment.

Google has provided examples of such tests, for java, but not for python link. Do anybody know how to setup database locally, during test setup on python?

A: 

Use NoseGAE. It sets up the development environment so you can test datastore and other APIs. Then, and this one is not required, gaetestbed provides some helpers to cleanup datastore or memcache etc between tests.

moraes
+1  A: 

You might also want to take a look at Fixture. It lets you easily create datasets that are loaded in a datastore stub at the beginning of every test. This answer has a specific example.

mahmoud