diff --git a/atdb/taskdatabase/templates/taskdatabase/index.html b/atdb/taskdatabase/templates/taskdatabase/index.html index 0e67068a191fb73ea3e9dc61c3cf0e2d2689fd2c..810b5d6adc7c4c67702f5e0c9247d26860b75124 100644 --- a/atdb/taskdatabase/templates/taskdatabase/index.html +++ b/atdb/taskdatabase/templates/taskdatabase/index.html @@ -31,7 +31,7 @@ {% include 'taskdatabase/pagination.html' %} </div> </div> - <p class="footer"> Version 8 Aug 2024 + <p class="footer"> Version 13 Aug 2024 </div> {% include 'taskdatabase/refresh.html' %} diff --git a/atdb/taskdatabase/tests/test_algorithms.py b/atdb/taskdatabase/tests/test_algorithms.py index 70e2ff4922e732b173db68a9091f06104bdfa088..7b144d8afd25323644d9d390f33a1c5654afd116 100644 --- a/atdb/taskdatabase/tests/test_algorithms.py +++ b/atdb/taskdatabase/tests/test_algorithms.py @@ -1,14 +1,13 @@ from django.test import TestCase from django.utils import timezone from datetime import datetime -from taskdatabase.models import LogEntry, Task, Workflow, Job +from taskdatabase.models import LogEntry, Task, Workflow, Job, Configuration from taskdatabase.services import algorithms from unittest.mock import Mock, MagicMock, patch class TestAlgorithms(TestCase): def setUp(self): - # Create a Task instance to use in the LogEntry tests # used to test the get_size calculation, this uses a database self.workflow = Workflow(id=22, workflow_uri="psrfits_requantisation") @@ -240,6 +239,7 @@ class TestAlgorithms(TestCase): self.assertIn("<tr><td><b>QA uv-coverage</b></td><td>Good</td></tr>", result) self.assertIn("<tr><td><b>QA sensitivity</b></td><td>Moderate</td></tr>", result) + def test_convert_quality_to_html_complete(self): # Comprehensive test with all fields filled @@ -290,6 +290,7 @@ class TestAlgorithms(TestCase): # assert self.assertEqual(expected_html, result) + def test_construct_inspection_plots_expand_image(self): # arrange @@ -300,6 +301,7 @@ class TestAlgorithms(TestCase): # assert self.assertEqual(expected_html, result) + def test_construct_inspection_plots_sas_id(self): # Test the rendering of inspection plots for a sas_id @@ -319,6 +321,7 @@ class TestAlgorithms(TestCase): # assert self.assertEqual(expected_html, result) + def test_convert_list_of_dicts_to_html(self): # arrange expected_html = '<tr><td><b>metric1</b></td><td>value1</td></tr><tr><td><b>metric2</b></td><td><a href="http://my_web_link">metric2</a></td></tr>' @@ -329,6 +332,7 @@ class TestAlgorithms(TestCase): # assert self.assertEqual(expected_html, result) + def test_convert_json_to_nested_table(self): # arrange @@ -342,4 +346,6 @@ class TestAlgorithms(TestCase): result = algorithms.convert_json_to_nested_table(self.task4.inputs) # assert - self.assertEqual(expected_html, result) \ No newline at end of file + self.assertEqual(expected_html, result) + + diff --git a/atdb/taskdatabase/views.py b/atdb/taskdatabase/views.py index 5a17786d3a9476f3a23104840a383d12dde28bfa..7919be2560a5dfcb8c2649efbf149e93000b09d2 100644 --- a/atdb/taskdatabase/views.py +++ b/atdb/taskdatabase/views.py @@ -1775,7 +1775,7 @@ def GetSummary(request, sas_id, format): @staff_member_required -def AssociateActivities(request): +def AssociateActivities(request): # pragma: no cover # disconnect the signals to avoid unneccesary updates disconnect_signals() @@ -1796,7 +1796,7 @@ def AssociateActivities(request): return redirect('index') -def UpdateActivitySasId(request, sas_id): +def UpdateActivitySasId(request, sas_id): # pragma: no cover # this function is called externally to avoid worker timeouts # http://localhost:8000/atdb/tasks/repair/update-activity/600907 @@ -1825,7 +1825,7 @@ def UpdateActivitySasId(request, sas_id): 'total': total }) -def UpdateSummaryFlag(request, task_id): +def UpdateSummaryFlag(request, task_id): # pragma: no cover # this function is called externally to avoid worker timeouts # http://localhost:8000/atdb/tasks/repair/update-summary-flag/12345