Skip to content

Commit

Permalink
LIKA-606: Added test for xroad_removed hiding subsystems
Browse files Browse the repository at this point in the history
  • Loading branch information
bzar committed Mar 6, 2024
1 parent 8fb36c5 commit 09f7dd8
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions ckanext/ckanext-apicatalog/ckanext/apicatalog/tests/test_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,3 +238,18 @@ def test_old_business_ids_output_with_list(self):
organization_with_python_list = Organization(old_business_ids=['1', '2'])

assert organization_with_python_list['old_business_ids'] == ['1', '2']

def test_user_should_not_see_subsystems_removed_from_xroad(self, app):
org = factories.Organization()
subsystem = factories.Dataset(
owner_org=org["id"],
xroad_removed=True
)

with app.flask_app.test_request_context():
app.flask_app.preprocess_request()
with pytest.raises(ObjectNotFound):
get_action('package_show')({}, {"id": subsystem['id']})

search = get_action('package_search')({}, {})
assert all(result['id'] != subsystem['id'] for result in search['results'])

0 comments on commit 09f7dd8

Please sign in to comment.