authentic/tests/test_ou_manager.py

22 lines
644 B
Python

from utils import login
def test_manager_ou_export(app, admin, ou1, role_ou1, ou2, role_ou2):
response = login(app, admin, 'a2-manager-ous')
export_response = response.click('JSON')
export = export_response.json
assert export.keys() == ['ous']
assert len(export['ous']) == 3
assert set([ou['slug'] for ou in export['ous']]) == set(['default', 'ou1', 'ou2'])
response.form.set('search-text', 'ou1')
search_response = response.form.submit()
export_response = search_response.click('JSON')
export = export_response.json
assert len(export['ous']) == 1
assert export['ous'][0]['slug'] == 'ou1'