From 3c95b293f5bebb79180799c153271c7828a6be0e Mon Sep 17 00:00:00 2001 From: Manuel Holtgrewe Date: Wed, 7 Apr 2021 16:52:51 +0200 Subject: [PATCH] Enabling tests that were pending on sodar-core v0.9.1 --- beaconsite/tests/test_permissions_ajax.py | 1 - clinvar_export/tests/test_permissions_ajax.py | 8 ++++---- clinvar_export/tests/test_views_ajax.py | 9 +++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/beaconsite/tests/test_permissions_ajax.py b/beaconsite/tests/test_permissions_ajax.py index 87f0e10f6..90833dfe3 100644 --- a/beaconsite/tests/test_permissions_ajax.py +++ b/beaconsite/tests/test_permissions_ajax.py @@ -57,7 +57,6 @@ def test_get(self, r_mock): class TestBeaconQueryAjaxView(TestProjectAPIPermissionBase): - @skip(reason="missing urlescape in sodar_core, fixed in 0.9.1") @requests_mock.Mocker() def test_get(self, r_mock): _local_site = SiteFactory(role=Site.LOCAL) diff --git a/clinvar_export/tests/test_permissions_ajax.py b/clinvar_export/tests/test_permissions_ajax.py index 900573b90..8b5233542 100644 --- a/clinvar_export/tests/test_permissions_ajax.py +++ b/clinvar_export/tests/test_permissions_ajax.py @@ -635,7 +635,6 @@ def test_delete(self): class TestQueryOmimAjaxViews(TestProjectAPIPermissionBase): """Permission tests for OMIM term AJAX views""" - @skip(reason="missing urlescape in sodar_core, fixed in 0.9.1") def test(self): hpo_record = HpoFactory() url = ( @@ -649,8 +648,9 @@ def test(self): self.delegate_as.user, self.contributor_as.user, self.guest_as.user, + self.user_no_roles, ] - bad_users = [self.anonymous, self.user_no_roles] + bad_users = [self.anonymous] self.assert_response(url, good_users, 200, method="GET") self.assert_response(url, bad_users, 302, method="GET") # redirect to login @@ -658,7 +658,6 @@ def test(self): class TestQueryHpoAjaxViews(TestProjectAPIPermissionBase): """Permission tests for the AJAX views for querying for HPO terms.""" - @skip(reason="missing urlescape in sodar_core, fixed in 0.9.1") def test(self): hpo_record = HpoNameFactory() url = ( @@ -672,8 +671,9 @@ def test(self): self.delegate_as.user, self.contributor_as.user, self.guest_as.user, + self.user_no_roles, ] - bad_users = [self.anonymous, self.user_no_roles] + bad_users = [self.anonymous] self.assert_response(url, good_users, 200, method="GET") self.assert_response(url, bad_users, 302, method="GET") # redirect to login diff --git a/clinvar_export/tests/test_views_ajax.py b/clinvar_export/tests/test_views_ajax.py index 136f17964..deadb0239 100644 --- a/clinvar_export/tests/test_views_ajax.py +++ b/clinvar_export/tests/test_views_ajax.py @@ -833,13 +833,14 @@ def test_query(self): response = self.client.get(url) self.assertEqual(response.status_code, 200) res_json = response.json() + lst = [x.strip() for x in hpo_record.name.split(";") if x.strip()] expected = jsonmatch.compile( { "query": hpo_record.database_id, "result": [ - {"term_id": "OMIM:0", "term_name": "Alternative Description"}, - {"term_id": "OMIM:0", "term_name": "Disease 0"}, - {"term_id": "OMIM:0", "term_name": "Gene Symbol"}, + {"term_id": hpo_record.database_id, "term_name": lst[2]}, + {"term_id": hpo_record.database_id, "term_name": lst[0]}, + {"term_id": hpo_record.database_id, "term_name": lst[1]}, ], } ) @@ -863,7 +864,7 @@ def test_query(self): expected = jsonmatch.compile( { "query": hpo_name_record.hpo_id, - "result": [{"term_id": "HP:0000000", "term_name": "Phenotype 0"}], + "result": [{"term_id": hpo_name_record.hpo_id, "term_name": hpo_name_record.name}], } ) expected.assert_matches(res_json)