To test my Google App Engine applications, I'm using nosegae, and gaetestbed. This seems to cover a lot of bases. I'd now like to create a test where users.get_current_user() returns a fake user of my choice. Ideally, I could change this from test to test independently.
The documentation at https://developers.google.com/appengine/docs/python/tools/localunittesting introduces google.appengine.ext.testbed which can do it. And the thread at Google App Engine set up a user when using testbed shows one way to do it.
The part I'm having trouble with is figuring out how to combine google.appengine.ext.testbed with nosegae and gaetestbed. It seems that nosegae and gaetestbed are already setting up the stubs and so on for me. And I know that gaetestbed is taking care of things like clearing the test datastore for me between tests. Do they setup a testbed object that I should find and call setup_env() on? Or should I create my own testbed object? Or would that conflict with nosegae and/or gaetestbed? Or maybe there's a way built into nosegae and gaetestbed which will help me do this type of thing? I've been searching documentation and the web to no avail so far.
Anyone know what the simplest/cleanest way to do this type of testing is?