Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions data/survey_config/sort_only_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions data/survey_config/sort_only_config_ahp.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions data/survey_config/sort_only_config_generic.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions data/survey_config/sort_only_config_midwives.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions data/survey_config/sort_only_config_nmahps.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions data/survey_config/sort_only_config_nurses.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions data/survey_config/sort_only_config_nurses_midwives.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
53 changes: 53 additions & 0 deletions survey/tests/test_models.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import json

from django.conf import settings
from django.db import IntegrityError
from django.test import TestCase

Expand Down Expand Up @@ -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}",
)
Loading