diff --git a/data/survey_config/sort_only_config.json b/data/survey_config/sort_only_config.json index a874f2bc..e749498e 100644 --- a/data/survey_config/sort_only_config.json +++ b/data/survey_config/sort_only_config.json @@ -173,8 +173,8 @@ "sublabels": [ "E1. Our organisation provides training for nurses to enable them to practise effectively in a digitally enabled environment", "E2. Our organisation trains nurses to use and interpret data to make improvements to care (using audit, service evaluation or research)", - "E3. Our organisation has digital nurse leaders in place who can provide advice and guidance in the use of digital technology in service development", - "E4. Our organisation has digital nurse leaders in place who can provide advice and guidance in the use of digital technology in research", + "E3. Our organisation has digital nurse leaders in place who can provide advice and guidance on the use of digital technology to support service development", + "E4. Our organisation has digital nurse leaders in place who can provide advice and guidance on the use of digital technology to support research", "E5. Our organisation has the infrastructure to support visualisation of data using business intelligence tools", "E6. Our organisation has the internal structures that facilitate, support and enable nurse-led digital innovation", "E7. Our organisation has effective partnerships with technology suppliers to support digital developments and innovation that meet the needs of nurses", diff --git a/data/survey_config/sort_only_config_ahp.json b/data/survey_config/sort_only_config_ahp.json index aa041615..4cc9abcc 100644 --- a/data/survey_config/sort_only_config_ahp.json +++ b/data/survey_config/sort_only_config_ahp.json @@ -173,8 +173,8 @@ "sublabels": [ "E1. Our organisation provides training for AHPs to enable them to practise effectively in a digitally enabled environment", "E2. Our organisation trains AHPs to use and interpret data to make improvements to care (using audit, service evaluation or research)", - "E3. Our organisation has digital AHP leaders in place who can provide advice and guidance in the use of digital technology in service development", - "E4. Our organisation has digital AHP leaders in place who can provide advice and guidance in the use of digital technology in research", + "E3. Our organisation has digital AHP leaders in place who can provide advice and guidance on the use of digital technology to support service development", + "E4. Our organisation has digital AHP leaders in place who can provide advice and guidance on the use of digital technology to support research", "E5. Our organisation has the infrastructure to support visualisation of data using business intelligence tools", "E6. Our organisation has the internal structures that facilitate, support and enable AHP-led digital innovation", "E7. Our organisation has effective partnerships with technology suppliers to support digital developments and innovation that meet the needs of AHPs", diff --git a/data/survey_config/sort_only_config_generic.json b/data/survey_config/sort_only_config_generic.json index 17709ad7..5c757e2b 100644 --- a/data/survey_config/sort_only_config_generic.json +++ b/data/survey_config/sort_only_config_generic.json @@ -173,8 +173,8 @@ "sublabels": [ "E1. Our organisation provides training to practise effectively in a digitally enabled environment", "E2. Our organisation trains staff to use and interpret data to make improvements to care (using audit, service evaluation or research)", - "E3. Our organisation has digital leaders in place who can provide advice and guidance in the use of digital technology in service development", - "E4. Our organisation has digital leaders in place who can provide advice and guidance in the use of digital technology in research", + "E3. Our organisation has digital leaders in place who can provide advice and guidance on the use of digital technology to support service development", + "E4. Our organisation has digital leaders in place who can provide advice and guidance on the use of digital technology to support research", "E5. Our organisation has the infrastructure to support visualisation of data using business intelligence tools", "E6. Our organisation has the internal structures that facilitate, support and enable staff-led digital innovation", "E7. Our organisation has effective partnerships with technology suppliers to support digital developments and innovation that meet the needs of staff", diff --git a/data/survey_config/sort_only_config_midwives.json b/data/survey_config/sort_only_config_midwives.json index 9aa2a8f1..9a88acf3 100644 --- a/data/survey_config/sort_only_config_midwives.json +++ b/data/survey_config/sort_only_config_midwives.json @@ -173,8 +173,8 @@ "sublabels": [ "E1. Our organisation provides training for midwives to enable them to practise effectively in a digitally enabled environment", "E2. Our organisation trains midwives to use and interpret data to make improvements to care (using audit, service evaluation or research)", - "E3. Our organisation has digital midwifery leaders in place who can provide advice and guidance in the use of digital technology in service development", - "E4. Our organisation has digital midwifery leaders in place who can provide advice and guidance in the use of digital technology in research", + "E3. Our organisation has digital midwifery leaders in place who can provide advice and guidance on the use of digital technology to support service development", + "E4. Our organisation has digital midwifery leaders in place who can provide advice and guidance on the use of digital technology to support research", "E5. Our organisation has the infrastructure to support visualisation of data using business intelligence tools", "E6. Our organisation has the internal structures that facilitate, support and enable midwifery-led digital innovation", "E7. Our organisation has effective partnerships with technology suppliers to support digital developments and innovation that meet the needs of midwives", diff --git a/data/survey_config/sort_only_config_nmahps.json b/data/survey_config/sort_only_config_nmahps.json index 8721f52c..5a5134b1 100644 --- a/data/survey_config/sort_only_config_nmahps.json +++ b/data/survey_config/sort_only_config_nmahps.json @@ -173,8 +173,8 @@ "sublabels": [ "E1. Our organisation provides training for NMAHPs to enable them to practise effectively in a digitally enabled environment", "E2. Our organisation trains NMAHPs to use and interpret data to make improvements to care (using audit, service evaluation or research)", - "E3. Our organisation has digital NMAHP leaders in place who can provide advice and guidance in the use of digital technology in service development", - "E4. Our organisation has digital NMAHP leaders in place who can provide advice and guidance in the use of digital technology in research", + "E3. Our organisation has digital NMAHP leaders in place who can provide advice and guidance on the use of digital technology to support service development", + "E4. Our organisation has digital NMAHP leaders in place who can provide advice and guidance on the use of digital technology to support research", "E5. Our organisation has the infrastructure to support visualisation of data using business intelligence tools", "E6. Our organisation has the internal structures that facilitate, support and enable NMAHP-led digital innovation", "E7. Our organisation has effective partnerships with technology suppliers to support digital developments and innovation that meet the needs of NMAHPs", diff --git a/data/survey_config/sort_only_config_nurses.json b/data/survey_config/sort_only_config_nurses.json index d951dba7..d44f39b0 100644 --- a/data/survey_config/sort_only_config_nurses.json +++ b/data/survey_config/sort_only_config_nurses.json @@ -173,8 +173,8 @@ "sublabels": [ "E1. Our organisation provides training for nurses to enable them to practise effectively in a digitally enabled environment", "E2. Our organisation trains nurses to use and interpret data to make improvements to care (using audit, service evaluation or research)", - "E3. Our organisation has digital nurse leaders in place who can provide advice and guidance in the use of digital technology in service development", - "E4. Our organisation has digital nurse leaders in place who can provide advice and guidance in the use of digital technology in research", + "E3. Our organisation has digital nurse leaders in place who can provide advice and guidance on the use of digital technology to support service development", + "E4. Our organisation has digital nurse leaders in place who can provide advice and guidance on the use of digital technology to support research", "E5. Our organisation has the infrastructure to support visualisation of data using business intelligence tools", "E6. Our organisation has the internal structures that facilitate, support and enable nurse-led digital innovation", "E7. Our organisation has effective partnerships with technology suppliers to support digital developments and innovation that meet the needs of nurses", diff --git a/data/survey_config/sort_only_config_nurses_midwives.json b/data/survey_config/sort_only_config_nurses_midwives.json index c7315ff5..3edde669 100644 --- a/data/survey_config/sort_only_config_nurses_midwives.json +++ b/data/survey_config/sort_only_config_nurses_midwives.json @@ -173,8 +173,8 @@ "sublabels": [ "E1. Our organisation provides training for nurses and midwives to enable them to practise effectively in a digitally enabled environment", "E2. Our organisation trains nurses and midwives to use and interpret data to make improvements to care (using audit, service evaluation or research)", - "E3. Our organisation has digital nurse and midwife leaders in place who can provide advice and guidance in the use of digital technology in service development", - "E4. Our organisation has digital nurse and midwife leaders in place who can provide advice and guidance in the use of digital technology in research", + "E3. Our organisation has digital nurse and midwife leaders in place who can provide advice and guidance on the use of digital technology to support service development", + "E4. Our organisation has digital nurse and midwife leaders in place who can provide advice and guidance on the use of digital technology to support research", "E5. Our organisation has the infrastructure to support visualisation of data using business intelligence tools", "E6. Our organisation has the internal structures that facilitate, support and enable nurse and midwife-led digital innovation", "E7. Our organisation has effective partnerships with technology suppliers to support digital developments and innovation that meet the needs of nurses and midwives", diff --git a/survey/tests/test_models.py b/survey/tests/test_models.py index 064065fa..a9520f0d 100644 --- a/survey/tests/test_models.py +++ b/survey/tests/test_models.py @@ -1,3 +1,6 @@ +import json + +from django.conf import settings from django.db import IntegrityError from django.test import TestCase @@ -64,3 +67,53 @@ def test_generic_profession_configuration(self): # Verify fields are accessible self.assertIsNotNone(survey.fields) self.assertTrue(survey.fields) + + +class TestSurveyConfigSublabels(TestCase): + """ + Regression tests for sublabel wording in survey config JSON files. + Guards against double spaces and incorrect phrasing in E3/E4 sublabels. + """ + + def _get_all_sublabels(self, config: dict) -> list[str]: + sublabels = [] + for section in config.get("sections", []): + for field in section.get("fields", []): + sublabels.extend(field.get("sublabels", [])) + return sublabels + + def _load_config(self, filename: str) -> dict: + path = settings.SURVEY_TEMPLATE_DIR / filename + with path.open() as f: + return json.load(f) + + def test_no_double_spaces_in_e3_e4_sublabels(self): + """E3 and E4 sublabels must not contain double spaces.""" + for filename in settings.SURVEY_TEMPLATES.values(): + config = self._load_config(filename) + sublabels = self._get_all_sublabels(config) + for label_prefix in ("E3.", "E4."): + text = next((s for s in sublabels if s.startswith(label_prefix)), None) + if text is None: + continue + self.assertNotIn( + " ", + text, + msg=f"Double space found in {label_prefix} sublabel in {filename!r}: {text!r}", + ) + + def test_e3_e4_sublabel_phrasing(self): + """E3 and E4 sublabels must use 'on the use of … to support' phrasing.""" + for filename in settings.SURVEY_TEMPLATES.values(): + config = self._load_config(filename) + sublabels = self._get_all_sublabels(config) + e3 = next((s for s in sublabels if s.startswith("E3.")), None) + e4 = next((s for s in sublabels if s.startswith("E4.")), None) + for label, text in [("E3", e3), ("E4", e4)]: + if text is None: + continue + self.assertIn( + "on the use of digital technology to support", + text, + msg=f"{label} sublabel in {filename!r} has unexpected phrasing: {text!r}", + )