]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
mgr/dashboard: fix REST API test cases
authorTatjana Dehler <tdehler@suse.com>
Tue, 17 Dec 2019 15:12:25 +0000 (16:12 +0100)
committerVolker Theile <vtheile@suse.com>
Thu, 2 Jan 2020 09:49:37 +0000 (10:49 +0100)
commit7015c2a82b744bbe38c846641db635f194d5bd9b
tree0cee4b57dbc9726f8905df004739d918e879568b
parent01c4bcadf6ee381e4947266c3b3eeebd0c0a9904
mgr/dashboard: fix REST API test cases

1. Fix the test cases by using the 'assertJsonBody'
   method. The '_post' method doesn't return anything.
   That's why we need to use the 'assertJsonBody'
   method here instead of checking the fields directly.

2. Add the missing scope and permission definition of the
   'validate_password' resource. Otherwise the resource
   is not restricted and 'test_validate_password_invalid_permissions'
   will fail.

3. Re-word error messages. Change 'cannot' to 'must not'.

Signed-off-by: Tatjana Dehler <tdehler@suse.com>
qa/tasks/mgr/dashboard/test_user.py
src/pybind/mgr/dashboard/controllers/user.py
src/pybind/mgr/dashboard/services/access_control.py