diff --git a/dataworkspace/dataworkspace/templates/datasets/data-preview/data_cut_source_preview.html b/dataworkspace/dataworkspace/templates/datasets/data-preview/data_cut_source_preview.html index f598cbaea8..2ac3134f09 100644 --- a/dataworkspace/dataworkspace/templates/datasets/data-preview/data_cut_source_preview.html +++ b/dataworkspace/dataworkspace/templates/datasets/data-preview/data_cut_source_preview.html @@ -89,9 +89,6 @@

{{ object.name }}

{% if columns or code_snippets and has_access %} - {% if columns %} - {% include "partials/column_list.html" with columns=columns dataset=dataset source=datacut_link %} - {% endif %} {% if code_snippets and has_access %}
diff --git a/dataworkspace/dataworkspace/templates/datasets/data-preview/data_sourceset_preview.html b/dataworkspace/dataworkspace/templates/datasets/data-preview/data_sourceset_preview.html index 8dd04c41bb..875521c0ea 100644 --- a/dataworkspace/dataworkspace/templates/datasets/data-preview/data_sourceset_preview.html +++ b/dataworkspace/dataworkspace/templates/datasets/data-preview/data_sourceset_preview.html @@ -89,9 +89,6 @@

{{ object.name }}

{% if columns or code_snippets and has_access %} - {% if columns %} - {% include "partials/column_list.html" with columns=columns dataset=dataset source=datacut_link %} - {% endif %} {% if code_snippets and has_access %}
diff --git a/dataworkspace/dataworkspace/templates/datasets/data-preview/reference_dataset_preview.html b/dataworkspace/dataworkspace/templates/datasets/data-preview/reference_dataset_preview.html index f7727c2989..7517a84e02 100644 --- a/dataworkspace/dataworkspace/templates/datasets/data-preview/reference_dataset_preview.html +++ b/dataworkspace/dataworkspace/templates/datasets/data-preview/reference_dataset_preview.html @@ -78,36 +78,11 @@

{{ model.name }}

{% if code_snippets or columns %} - {% if columns %} -
- - - View data structure for "{{ model.name }}" - - -
- -
-
- {% endif %} {% if model.external_database %} -
+
- Use this data for "{{ model.name }}" + Use this data for analysis
diff --git a/dataworkspace/dataworkspace/templates/datasets/data_cut_dataset.html b/dataworkspace/dataworkspace/templates/datasets/data_cut_dataset.html index ede0097523..c923bed885 100644 --- a/dataworkspace/dataworkspace/templates/datasets/data_cut_dataset.html +++ b/dataworkspace/dataworkspace/templates/datasets/data_cut_dataset.html @@ -232,9 +232,6 @@

Data

{% if columns or code_snippets and has_access %} - {% if columns %} - {% include "partials/column_list.html" with columns=columns dataset=dataset source=datacut_link %} - {% endif %} {% if code_snippets and has_access %}
diff --git a/dataworkspace/dataworkspace/templates/datasets/master_dataset.html b/dataworkspace/dataworkspace/templates/datasets/master_dataset.html index 9c7dc07bc1..44e89e231d 100644 --- a/dataworkspace/dataworkspace/templates/datasets/master_dataset.html +++ b/dataworkspace/dataworkspace/templates/datasets/master_dataset.html @@ -234,12 +234,6 @@

Data

{% if code_snippets or columns %} - {% if columns %} -
- {% include "partials/column_list.html" with columns=columns dataset=dataset source=source_table %} -
- {% endif %} - {% if has_access %}
diff --git a/dataworkspace/dataworkspace/templates/datasets/referencedataset_detail.html b/dataworkspace/dataworkspace/templates/datasets/referencedataset_detail.html index 8bfbbd85e2..880aba7264 100644 --- a/dataworkspace/dataworkspace/templates/datasets/referencedataset_detail.html +++ b/dataworkspace/dataworkspace/templates/datasets/referencedataset_detail.html @@ -241,36 +241,11 @@

Data

{% if code_snippets or columns %} - {% if columns %} -
- - - View data structure for "{{ model.name }}" - - -
- -
-
- {% endif %} {% if model.external_database %}
- Use this data for "{{ model.name }}" + Use this data for analysis
diff --git a/dataworkspace/dataworkspace/templates/partials/column_list.html b/dataworkspace/dataworkspace/templates/partials/column_list.html deleted file mode 100644 index 50ea060fac..0000000000 --- a/dataworkspace/dataworkspace/templates/partials/column_list.html +++ /dev/null @@ -1,28 +0,0 @@ -
- - - View data structure - - for {% if source.schema %}"{{ source.schema }}"."{{ source.table }}"{% else %}{{ source.name }}{% endif %} - - - -
- -
-
diff --git a/dataworkspace/dataworkspace/tests/datasets/test_views.py b/dataworkspace/dataworkspace/tests/datasets/test_views.py index c50f602398..256ba70c3f 100644 --- a/dataworkspace/dataworkspace/tests/datasets/test_views.py +++ b/dataworkspace/dataworkspace/tests/datasets/test_views.py @@ -1773,52 +1773,6 @@ def test_reference_dataset_shows_code_snippets(self, mock_sync): in response.content.decode(response.charset) ) - @pytest.mark.parametrize( - "request_client,published", - [("client", True), ("staff_client", True), ("staff_client", False)], - indirect=["request_client"], - ) - @pytest.mark.django_db - def test_reference_dataset_shows_column_details(self, request_client, published): - group = factories.DataGroupingFactory.create() - external_db = factories.DatabaseFactory.create(memorable_name="my_database") - rds = factories.ReferenceDatasetFactory.create( - published=published, - group=group, - external_database=external_db, - ) - field1 = factories.ReferenceDatasetFieldFactory.create( - reference_dataset=rds, - name="code", - column_name="code", - data_type=2, - is_identifier=True, - ) - field2 = factories.ReferenceDatasetFieldFactory.create( - reference_dataset=rds, name="name", column_name="name", data_type=1 - ) - rds.save_record( - None, - { - "reference_dataset": rds, - field1.column_name: 1, - field2.column_name: "Test record", - }, - ) - rds.save_record( - None, - { - "reference_dataset": rds, - field1.column_name: 2, - field2.column_name: "Ánd again", - }, - ) - response = request_client.get(rds.get_absolute_url()) - - assert response.status_code == 200 - assert "code (integer)" in response.content.decode(response.charset) - assert "name (text)" in response.content.decode(response.charset) - @pytest.mark.parametrize( "request_client,published", [("client", True), ("staff_client", True), ("staff_client", False)], @@ -2002,39 +1956,6 @@ def test_datacut_dataset_shows_code_snippets_to_tool_user(metadata_db): assert """SELECT * FROM foo""" in response.content.decode(response.charset) -@pytest.mark.parametrize( - "dataset_type, source_factory,source_type", - ( - (DataSetType.MASTER, factories.SourceTableFactory, "table"), - (DataSetType.DATACUT, factories.CustomDatasetQueryFactory, "datacut"), - ), -) -@mock.patch("dataworkspace.apps.datasets.views.datasets_db.get_columns") -@pytest.mark.django_db -def test_dataset_shows_first_12_columns_of_source_table_with_link_to_the_rest( - get_columns_mock, dataset_type, source_factory, source_type, metadata_db -): - ds = factories.DataSetFactory.create(type=dataset_type, published=True) - user = get_user_model().objects.create(email="test@example.com", is_superuser=False) - factories.DataSetUserPermissionFactory.create(user=user, dataset=ds) - st = source_factory.create( - dataset=ds, - database=factories.DatabaseFactory(memorable_name="my_database"), - ) - get_columns_mock.return_value = [(f"column_{i}", "integer") for i in range(20)] - - client = Client(**get_http_sso_data(user)) - response = client.get(ds.get_absolute_url()) - response_body = response.content.decode(response.charset) - doc = html.fromstring(response_body) - - assert response.status_code == 200 - for i in range(12): - assert f"column_{i} (integer)" in response_body - - assert len(doc.xpath(f"//a[@href = '/datasets/{ds.id}/{source_type}/{st.id}/columns']")) == 1 - - @pytest.mark.django_db(transaction=True) def test_launch_master_dataset_in_data_explorer(metadata_db): ds = factories.DataSetFactory.create(type=DataSetType.MASTER, published=True)