I run my google app engine application in one of two ways…
- Directly by using the application from http://localhost:8080
- Or execute unit tests from http://localhost:8080/test
When I create entities by using the application directly, the data is visible in the Development Console (dataStore view).
However, when I execute the unit tests… even if they succeed and I can put() and get() data, the data does not show in the dataStore view. Any idea why I can’t see my data? Even though it is there?
Notes:
- I use GAEUnit for unit tests.
- the data stored mostly consists of StringProperties().
- I use Python and run Django on top of the GAE, don’t know if that matters.
GAEUnit creates its own proxy stub datastore, using this code on line 357 of the current ‘2.0a for django’ release:
This proxy datastore is only held in memory, so is deleted once the tests finish running. It is also empty when the tests start running, ie it does not contain any data currently in the default development datastore.
You can temporarily modify this to make it write to a file on your development system, eg:
Then run dev_appserver.py on a different port, eg:
And then finally, open
http://localhost:8081/_ah/adminin a browser to view the contents of the temporary datastore.