Follow the flowcell link from the library page.
authorDiane Trout <diane@caltech.edu>
Mon, 13 Jun 2011 22:04:44 +0000 (15:04 -0700)
committerDiane Trout <diane@caltech.edu>
Mon, 13 Jun 2011 22:04:44 +0000 (15:04 -0700)
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
htsworkflow/frontend/experiments/views.py

index a37d632a0b11d424e61291b13cc6d795d1c9a278..664547bfb7e5d799fca4e4036eb6221762197af8 100644 (file)
@@ -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):
index 827f5219ef05870f65735a82077e9b373def1028..e1204135424dca941ca1d7a0044337b719b0ca67 100755 (executable)
@@ -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()