Remove django test environment setup code.
authorDiane Trout <diane@ghic.org>
Fri, 17 Jan 2014 23:04:22 +0000 (15:04 -0800)
committerDiane Trout <diane@ghic.org>
Fri, 17 Jan 2014 23:04:22 +0000 (15:04 -0800)
I've found djangos ./manage.py test to work quite well these days,
and attempting to manually setup the django test environment generates
an exception on shutdown.

htsworkflow/frontend/experiments/test_experiments.py
htsworkflow/frontend/inventory/test_inventory.py
htsworkflow/frontend/samples/test_samples.py
htsworkflow/submission/test/test_condorfastq.py

index 8907192cf46376b1b8a28639f9a8c44207a5ef72..11214b1163ad4fb2a4b6a7de1879cc8095847a97 100644 (file)
@@ -30,17 +30,6 @@ NSMAP = {'libns':'http://jumpgate.caltech.edu/wiki/LibraryOntology#'}
 
 from django.db import connection
 
-OLD_DB_NAME = settings.DATABASES['default']['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']
 
@@ -688,16 +677,6 @@ 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
     suite = TestSuite()
index 86d37b7cbe7e740468f04df9380ae8fa82c98b35..d7c2336b0866848ea49bc090e1cfbafbdbbc1fd4 100644 (file)
@@ -113,15 +113,6 @@ class InventoryTestCase(TestCase):
         flowcells = [ str(x.uri) for x in targets]
         return flowcells
 
-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
     suite = TestSuite()
index f0844e55cce7fbf3b33fbdfbf03b9d9264b3e13a..594f2813e6519988b42abccf0c070a81c99c16f8 100644 (file)
@@ -332,15 +332,6 @@ def get_rdf_memory_model():
     model = RDF.Model(storage)
     return model
 
-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
     suite = TestSuite()
index 09d68083c1ec50052c450a71e9d9e24356573cf7..1e1c2d9bc56677cdef09b5b2efca48d296e5fdb3 100644 (file)
@@ -680,16 +680,6 @@ class TestCondorFastq(TestCase):
             self.assertTrue('12345_C02F9ACXX_c202_l3_r2.fastq' in arguments[3])
 
 
-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
     suite = TestSuite()