diff --git a/schemas/test/en/test_supplementary_data_with_sds_schema_version.json b/schemas/test/en/test_supplementary_data_with_sds_schema_version.json deleted file mode 100644 index 9d9c699a01..0000000000 --- a/schemas/test/en/test_supplementary_data_with_sds_schema_version.json +++ /dev/null @@ -1,192 +0,0 @@ -{ - "mime_type": "application/json/ons/eq", - "language": "en", - "schema_version": "0.0.1", - "sds_schema_version": "v1", - "data_version": "0.0.3", - "survey_id": "123", - "title": "Test Supplementary Data with sds_schema_version Field", - "theme": "default", - "description": "A questionnaire to demo the support of the sds_schema_version field in schemas", - "metadata": [ - { - "name": "survey_id", - "type": "string" - }, - { - "name": "user_id", - "type": "string" - }, - { - "name": "period_id", - "type": "string" - }, - { - "name": "ru_name", - "type": "string" - }, - { - "name": "sds_dataset_id", - "type": "string" - } - ], - "supplementary_data": { - "lists": ["employees", "products"] - }, - "questionnaire_flow": { - "type": "Hub", - "options": { - "required_completed_sections": ["introduction-section"] - } - }, - "post_submission": { - "view_response": true - }, - "sections": [ - { - "id": "introduction-section", - "title": "Introduction", - "groups": [ - { - "id": "introduction-group", - "title": "Introduction Group", - "blocks": [ - { - "id": "loaded-successfully-block", - "type": "Interstitial", - "content": { - "title": "Supplementary Data", - "contents": [ - { - "title": "You have successfully loaded Supplementary data", - "description": { - "text": "List of products: {products}", - "placeholders": [ - { - "placeholder": "products", - "transforms": [ - { - "transform": "format_list", - "arguments": { - "list_to_format": { - "source": "supplementary_data", - "identifier": "products", - "selectors": ["name"] - } - } - } - ] - } - ] - }, - "guidance": { - "contents": [ - { - "description": { - "text": "The purpose of this block is to test the survey opens successfully, given that sds_schema_version (defined in the questionnaire schema) matches the version set in the supplementary data payload. Separate to using the supplementary data, the surnames of the employees are: {surnames}.", - "placeholders": [ - { - "placeholder": "surnames", - "transforms": [ - { - "transform": "concatenate_list", - "arguments": { - "list_to_concatenate": [ - { - "source": "supplementary_data", - "identifier": "employees", - "selectors": ["personal_details", "surname"] - } - ], - "delimiter": ", " - } - } - ] - } - ] - } - } - ] - } - } - ] - } - }, - { - "id": "introduction-block", - "type": "Introduction", - "primary_content": [ - { - "id": "business-details", - "title": { - "text": "You are completing this survey for {company_name}", - "placeholders": [ - { - "placeholder": "company_name", - "value": { - "source": "supplementary_data", - "identifier": "company_name" - } - } - ] - }, - "contents": [ - { - "description": { - "text": "If the company details or structure have changed contact us on {telephone_number_link}", - "placeholders": [ - { - "placeholder": "telephone_number_link", - "value": { - "source": "supplementary_data", - "identifier": "company_details", - "selectors": ["telephone_number"] - } - } - ] - } - }, - { - "guidance": { - "contents": [ - { - "title": "Guidance for completing this survey", - "list": [ - "The company name, telephone number all come from supplementary data", - "if you picked the supplementary dataset with guidance, there will be a 3rd bullet point below this one, with the supplementary guidance.", - { - "text": "{survey_guidance}", - "placeholders": [ - { - "placeholder": "survey_guidance", - "transforms": [ - { - "transform": "first_non_empty_item", - "arguments": { - "items": [ - { - "source": "supplementary_data", - "identifier": "guidance" - } - ] - } - } - ] - } - ] - } - ] - } - ] - } - } - ] - } - ] - } - ] - } - ] - } - ] -} diff --git a/tests/integration/session/test_login.py b/tests/integration/session/test_login.py index eedeadc0ec..99b663882c 100644 --- a/tests/integration/session/test_login.py +++ b/tests/integration/session/test_login.py @@ -1,7 +1,7 @@ import time from httmock import HTTMock, response, urlmatch -from mock.mock import patch +from unittest.mock import patch, Mock from app.utilities.schema import ( CIR_RETRIEVE_COLLECTION_INSTRUMENT_URL, @@ -12,6 +12,9 @@ SCHEMA_PATH_MAP = get_schema_path_map(include_test_schemas=True) +# pylint: disable-next=line-too-long +DATA = "eyJhbGciOiJSU0EtT0FFUCIsImVuYyI6IkEyNTZHQ00iLCJraWQiOiJkZjg4ZmRhZDI2MTJhZTFlODA1NzExMjBlNmM2MzcxZjU1ODk2Njk3In0.lssJXsMUE3dhWtQRUt7DTaZJvx4DpNdLW98cu8g4NijYX9TFpJiOFyzPxUlpFZb-fMa4zW9q6qZofQeQTbl_Ae3QAwGhuWF7v9NMdWM1aH377byyJJyJpdqlU4t-P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egrationTestCase): def test_login_with_no_token_should_be_unauthorized(self): @@ -366,30 +369,6 @@ def test_login_token_with_invalid_cir_instrument_id_results_in_500(self): # Then self.assertException() - @patch("app.routes.session.get_supplementary_data_v1") - @patch("app.routes.session._validate_supplementary_data_lists") - @patch( - "app.questionnaire.questionnaire_store_updater.QuestionnaireStoreUpdaterBase.set_supplementary_data", - ) - def test_login_with_sds_schema_version_valid( - self, mock_get, mock_validate, mock_set - ): - - # Given - schema_to_launch = "test_supplementary_data_with_sds_schema_version" - - # When - self.launchSupplementaryDataSurvey( - schema_name=schema_to_launch, - sds_dataset_id="203b2f9d-c500-8175-98db-86ffcfdccfa3", - ) - - # Then - mock_get.assert_called_once() - mock_validate.assert_called_once() - mock_set.assert_called_once() - self.assertStatusOK() - @staticmethod @urlmatch(netloc=r"eq-survey-register", path=r"\/my-test-schema") def _schema_url_mock(_url, _request):