Change unittest2 back into unittest.
[htsworkflow.git] / htsworkflow / frontend / experiments / test_experiments.py
index 5878d726d7ee1d268382230a56a235aef7ca29e6..b7474d9349dff20029150703b67ec42e359ff777 100644 (file)
@@ -29,16 +29,6 @@ LANE_SET = range(1,9)
 NSMAP = {'libns':'http://jumpgate.caltech.edu/wiki/LibraryOntology#'}
 
 from django.db import connection
-OLD_DB_NAME = settings.DATABASE_NAME
-VERBOSITY = 0
-def setUpModule():
-    setup_test_environment()
-    settings.DEBUG = False
-    connection.creation.create_test_db(VERBOSITY)
-
-def tearDownModule():
-    connection.creation.destroy_test_db(OLD_DB_NAME, VERBOSITY)
-    teardown_test_environment()
 
 class ClusterStationTestCases(TestCase):
     fixtures = ['test_flowcells.json']
@@ -298,8 +288,8 @@ class ExperimentsTestCases(TestCase):
         tree = fromstring(response.content)
         flowcell_spans = tree.xpath('//span[@property="libns:flowcell_id"]',
                                     namespaces=NSMAP)
-        self.assertEqual(flowcell_spans[0].text, '30012AAXX (failed)')
-        failed_fc_span = flowcell_spans[0]
+        self.assertEqual(flowcell_spans[1].text, '30012AAXX (failed)')
+        failed_fc_span = flowcell_spans[1]
         failed_fc_a = failed_fc_span.getparent()
         # make sure some of our RDF made it.
         self.assertEqual(failed_fc_a.get('typeof'), 'libns:IlluminaFlowcell')
@@ -687,18 +677,8 @@ class TestSequencer(TestCase):
         errmsgs = list(inference.run_validation())
         self.assertEqual(len(errmsgs), 0)
 
-
-OLD_DB = settings.DATABASES['default']['NAME']
-def setUpModule():
-    setup_test_environment()
-    connection.creation.create_test_db()
-
-def tearDownModule():
-    connection.creation.destroy_test_db(OLD_DB)
-    teardown_test_environment()
-
 def suite():
-    from unittest2 import TestSuite, defaultTestLoader
+    from unittest import TestSuite, defaultTestLoader
     suite = TestSuite()
     for testcase in [ClusterStationTestCases,
                      SequencerTestCases,
@@ -710,5 +690,5 @@ def suite():
     return suite
 
 if __name__ == "__main__":
-    from unittest2 import main
+    from unittest import main
     main(defaultTest="suite")