From 20c98a9d4d39efc4fd2b1a376bd1a73ea14d1144 Mon Sep 17 00:00:00 2001 From: Diane Trout Date: Mon, 13 Jun 2011 15:04:44 -0700 Subject: [PATCH] Follow the flowcell link from the library page. Need to test to make sure that flowcells with parentheticall comments are accessible. e.g. 12345AAXX (failed) -> /flowcell/12345AAXX/ and the flowcell link actually returns a page. --- htsworkflow/frontend/experiments/tests.py | 6 ++++++ htsworkflow/frontend/experiments/views.py | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/htsworkflow/frontend/experiments/tests.py b/htsworkflow/frontend/experiments/tests.py index a37d632..664547b 100644 --- a/htsworkflow/frontend/experiments/tests.py +++ b/htsworkflow/frontend/experiments/tests.py @@ -160,6 +160,7 @@ class ExperimentsTestCases(TestCase): def test_library_to_flowcell_link(self): """ Make sure the library page includes links to the flowcell pages. + That work with flowcell IDs that have parenthetical comments. """ self.client.login(username='supertest', password='BJOKL5kAj6aFZ6A5') response = self.client.get('/library/11070/') @@ -169,6 +170,11 @@ class ExperimentsTestCases(TestCase): # make sure some of our RDF made it. self.failUnlessEqual(failed_fc_a.get('rel'), 'libns:flowcell') self.failUnlessEqual(failed_fc_a.get('href'), '/flowcell/30012AAXX/') + fc_response = self.client.get(failed_fc_a.get('href')) + self.failUnlessEqual(fc_response.status_code, 200) + fc_lane_response = self.client.get('/flowcell/30012AAXX/8/') + self.failUnlessEqual(fc_lane_response.status_code, 200) + def test_lanes_for(self): diff --git a/htsworkflow/frontend/experiments/views.py b/htsworkflow/frontend/experiments/views.py index 827f521..e120413 100755 --- a/htsworkflow/frontend/experiments/views.py +++ b/htsworkflow/frontend/experiments/views.py @@ -130,7 +130,7 @@ def finishedEmail(request, pk): def flowcell_detail(request, flowcell_id): - fc = get_object_or_404(FlowCell, flowcell_id=flowcell_id) + fc = get_object_or_404(FlowCell, flowcell_id__startswith=flowcell_id) fc.update_data_runs() context = RequestContext(request, @@ -140,7 +140,7 @@ def flowcell_detail(request, flowcell_id): context) def flowcell_lane_detail(request, flowcell_id, lane_number): - fc = get_object_or_404(FlowCell, flowcell_id=flowcell_id) + fc = get_object_or_404(FlowCell, flowcell_id__startswith=flowcell_id) lane = get_object_or_404(fc.lane_set, lane_number=lane_number) fc.update_data_runs() -- 2.30.2