From c8c091c8e2833ce022c316cf498122b2af720f49 Mon Sep 17 00:00:00 2001 From: Munyoki Kilyungi Date: Mon, 20 Mar 2023 12:18:14 +0300 Subject: Disable editing case-attributes ATM, editing case-attributes is very buggy. * wqflask/tests/integration/wqflask/test_metadata_edits.py: Delete. * wqflask/wqflask/decorators.py: Remove: gn3.authentication.get_groups_by_user_uid import. (case_attributes_edit_access): Delete. * wqflask/tests/integration/wqflask/test_metadata_edits.py: Remove wqflask.decorators.case_attributes_edit_access, gn3.db.case_attributes.get_case_attributes, gn3.db.case_attributes.get_unreviewed_diffs, gn3.db.case_attributes.insert_case_attribute_audit, gn3.db.case_attributes.reject_case_attribute and gn3.db.case_attributes.approve_case_attribute. (display_phenotype_metadata): Remove headers arg when rendering template. (update_phenotype): Remove case attribute headers list when updating a phenotype. (show_case_attribute_columns, update_case_attributes): Delete. (reject_case_attribute_data, approve_case_attribute_data): Ditto. * wqflask/wqflask/templates/edit_phenotype.html: Remove link that shows all the listed case-attributes. Signed-off-by: Munyoki Kilyungi --- .../integration/wqflask/test_metadata_edits.py | 43 ---------------------- 1 file changed, 43 deletions(-) delete mode 100644 wqflask/tests/integration/wqflask/test_metadata_edits.py (limited to 'wqflask/tests') diff --git a/wqflask/tests/integration/wqflask/test_metadata_edits.py b/wqflask/tests/integration/wqflask/test_metadata_edits.py deleted file mode 100644 index ba7a18c9..00000000 --- a/wqflask/tests/integration/wqflask/test_metadata_edits.py +++ /dev/null @@ -1,43 +0,0 @@ -"""Tests for wqflask/wqflask/metadata_edits.py""" -import unittest -from unittest import mock - -from wqflask import app - - -class MetadataEditsTest(unittest.TestCase): - """Test Cases for MetadataEdits""" - - def setUp(self): - self.app = app.test_client() - self.app_context = app.app_context() - self.app_context.push() - - def tearDown(self): - self.app_context.pop() - - @unittest.skip("TO-FIX or Delete") - @mock.patch("wqflask.metadata_edits.database_connection") - @mock.patch("wqflask.metadata_edits.get_case_attributes") - def test_show_case_attributes(self, mock_case_attrs, mock_conn): - """Test that case attributes are displayed correctly""" - mock_case_attrs.return_value = { - "Condition (1)": "", - "Tissue": "", - "Age": "Cum sociis natoque penatibus et magnis dis", - "Condition (4)": "Description A", - "Condition (5)": "Description B", - } - response = self.app.get( - "/datasets/case-attributes", follow_redirects=True - ).data.decode() - self.assertIn( - "Condition (1)No description", response - ) - self.assertIn("TissueNo description", response) - self.assertIn( - "AgeCum sociis natoque penatibus et magnis dis", - response, - ) - self.assertIn("Condition (4)Description A", response) - self.assertIn("Condition (5)Description B", response) -- cgit v1.2.3