Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can not override auth config options from tests #2035

Merged
merged 7 commits into from
Nov 19, 2014

Conversation

amercader
Copy link
Member

When writing auth tests, using the @helpers.change_config() decorator on an auth option has no effect. The reason is that auth functions call new_authz.py.check_config_permission which caches the config and default values the first time is run.

I think is worth not caching the values and allowing them to be overriden from tests than the performance gains.

Otherwise the values can not be overriden from tests
The old auth tests are terrible in that they depend on each other to
run. Also the auth cache thing masked some bad assumptions.

The whole file should be rewritten as new tests.
Because `.bar` is being recognized as a gTLD, it points to
`127.0.53.53`, which if you have a web server running will return
localhost (and a 200 status).

More details:

https://stackoverflow.com/questions/25662590/domain-foo-bar-points-127-0-53-53-why
@amercader amercader assigned wardi and unassigned amercader Nov 10, 2014

if key == 'roles_that_cascade_to_sub_groups':
# This permission is set as a list of strings (space separated)
value = value.split(' ') if value else []
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how about split() with no argument? then it will split on any white-space (and any amount of it) and strips white-space on either side too.

@amercader
Copy link
Member Author

@wardi done

@wardi wardi merged commit 99e5ee0 into master Nov 19, 2014
@smotornyuk smotornyuk deleted the 2035-remove-auth-permissions-cache branch December 19, 2018 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants