4046ef6616
The scenario configuration in openstack_auth test_auth was ignored somehow. Perhaps it happened when openstack_auth was merged into the horizon repo as test runners used in the horizon repo so far (django test runner, nose and pytest) do not support testscenarios. This commit tries to recover the original intention of the scenario. pytest supports several ways to parametrize tests [1] but there seems no way without changing each test functions. A quick port of "testscenarios" is explained [2], but it is just a way to generate tests based on scenarios and we still need to add scenario parameters to each test function, so we cannot refer scenario parameters in setUp(). As a result, I chose a way to inherit the original class and pass different attributes per scenario. This is not ideal and I hope pytest lovers can improve the situation. The test classes in test_auth are renamed to more meaningful ones. Direct overrides of settings in test_auth.py are improved too. [1] https://docs.pytest.org/en/stable/example/parametrize.html [2] https://docs.pytest.org/en/stable/example/parametrize.html#a-quick-port-of-testscenarios Change-Id: I1538ffbc853a2c9328c364f462a27be36c85cc2f |
||
---|---|---|
.. | ||
locale | ||
plugin | ||
tests | ||
__init__.py | ||
backend.py | ||
defaults.py | ||
exceptions.py | ||
forms.py | ||
middleware.py | ||
models.py | ||
policy.py | ||
urls.py | ||
user.py | ||
utils.py | ||
views.py |