Skip to content

Commit

Permalink
feat(Courts): update name of old_docs to historic_docs so intent is c…
Browse files Browse the repository at this point in the history
…learer
  • Loading branch information
jacksonj04 committed Jan 21, 2025
1 parent cf13ff0 commit f7f966e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
6 changes: 4 additions & 2 deletions src/ds_caselaw_utils/courts.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,13 @@ def _render_markdown_text(self, type: str) -> Optional[str]:

@cached_property
def description_text_as_html(self) -> Optional[str]:
"""Get the description of the court (where present)."""
return self._render_markdown_text("description")

@cached_property
def old_documents_support_text_as_html(self) -> Optional[str]:
return self._render_markdown_text("old_docs")
def historic_documents_support_text_as_html(self) -> Optional[str]:
"""Get support information (where present) on accessing historic court documents not held in FCL."""
return self._render_markdown_text("historic_docs")

def __repr__(self) -> str:
return self.name
Expand Down
6 changes: 3 additions & 3 deletions src/ds_caselaw_utils/test_courts.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,12 +419,12 @@ def test_description_text_as_html(self, mock_render):
mock_render.assert_called_once_with("description")

@patch("ds_caselaw_utils.courts.Court._render_markdown_text")
def test_old_documents_support_text_as_html(self, mock_render):
def test_historic_documents_support_text_as_html(self, mock_render):
court = CourtFactory({"param": "test"})
mock_render.return_value = "<p>Support text.</p>"

assert court.old_documents_support_text_as_html == "<p>Support text.</p>"
mock_render.assert_called_once_with("old_docs")
assert court.historic_documents_support_text_as_html == "<p>Support text.</p>"
mock_render.assert_called_once_with("historic_docs")


class TestCourtWithJurisdiction(unittest.TestCase):
Expand Down

0 comments on commit f7f966e

Please sign in to comment.