Skip to content

Commit

Permalink
[#1664] clear auth functions cache when changing config
Browse files Browse the repository at this point in the history
  • Loading branch information
wardi committed Jun 13, 2014
1 parent 746cfc5 commit 318891e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ckan/new_tests/helpers.py
Expand Up @@ -24,6 +24,7 @@
import ckan.config.middleware
import ckan.model as model
import ckan.logic as logic
import ckan.new_authz as new_authz


def reset_db():
Expand Down Expand Up @@ -163,11 +164,13 @@ def decorator(func):
def wrapper(*args, **kwargs):
_original_config = config.copy()
config[key] = value
new_authz.clear_auth_functions_cache()

return_value = func(*args, **kwargs)

config.clear()
config.update(_original_config)
new_authz.clear_auth_functions_cache()

return return_value
return nose.tools.make_decorator(func)(wrapper)
Expand Down

0 comments on commit 318891e

Please sign in to comment.