about summary refs log tree commit diff
path: root/wqflask/tests
diff options
context:
space:
mode:
authorMunyoki Kilyungi2023-03-20 12:18:14 +0300
committerBonfaceKilz2023-03-20 22:05:46 +0300
commitc8c091c8e2833ce022c316cf498122b2af720f49 (patch)
tree9472c5e678688b87081da90943bd2394d8d2a074 /wqflask/tests
parent6e45510c3ee685a960db594aef70661220bebe60 (diff)
downloadgenenetwork2-c8c091c8e2833ce022c316cf498122b2af720f49.tar.gz
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 <me@bonfacemunyoki.com>
Diffstat (limited to 'wqflask/tests')
-rw-r--r--wqflask/tests/integration/wqflask/test_metadata_edits.py43
1 files changed, 0 insertions, 43 deletions
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(
-            "<td>Condition (1)</td><td>No description</td>", response
-        )
-        self.assertIn("<td>Tissue</td><td>No description</td>", response)
-        self.assertIn(
-            "<td>Age</td><td>Cum sociis natoque penatibus et magnis dis</td>",
-            response,
-        )
-        self.assertIn("<td>Condition (4)</td><td>Description A</td>", response)
-        self.assertIn("<td>Condition (5)</td><td>Description B</td>", response)