diff options
author | Christopher Allan Webber <cwebber@dustycloud.org> | 2011-06-06 07:44:12 -0500 |
---|---|---|
committer | Christopher Allan Webber <cwebber@dustycloud.org> | 2011-06-06 07:44:12 -0500 |
commit | 66471f0ee4740daeac2b8a42b88dadec630b8d67 (patch) | |
tree | 38cc4e489be3136f5c198f42c169a8974a3639eb /mediagoblin/util.py | |
parent | 2fecc29d06f882541a2b476a618e22a0a90d2736 (diff) | |
download | mediagoblin-66471f0ee4740daeac2b8a42b88dadec630b8d67.tar.lz mediagoblin-66471f0ee4740daeac2b8a42b88dadec630b8d67.tar.xz mediagoblin-66471f0ee4740daeac2b8a42b88dadec630b8d67.zip |
A clear_test_buckets() method
Diffstat (limited to 'mediagoblin/util.py')
-rw-r--r-- | mediagoblin/util.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/mediagoblin/util.py b/mediagoblin/util.py index cbb937ee..64e21ca9 100644 --- a/mediagoblin/util.py +++ b/mediagoblin/util.py @@ -44,6 +44,26 @@ def _activate_testing(): TESTS_ENABLED = True +def clear_test_buckets(): + """ + We store some things for testing purposes that should be cleared + when we want a "clean slate" of information for our next round of + tests. Call this function to wipe all that stuff clean. + + Also wipes out some other things we might redefine during testing, + like the jinja envs. + """ + global SETUP_JINJA_ENVS + SETUP_JINJA_ENVS = {} + + global EMAIL_TEST_INBOX + global EMAIL_TEST_MBOX_INBOX + EMAIL_TEST_INBOX = [] + EMAIL_TEST_MBOX_INBOX = [] + + clear_test_template_context() + + def get_jinja_loader(user_template_path=None): """ Set up the Jinja template loaders, possibly allowing for user |