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 authored and amercader committed Jun 25, 2014
1 parent 35997c1 commit 7e30456
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 @@ -142,11 +143,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 7e30456

Please sign in to comment.