Update to Django 1.1.1.  I want to use a new feature for my RESTful interface prototyping (direct inclusion of URL patterns in URLconfs).

The one obstacle this presented was that Django 1.1.1 changes the DB connection object to accept DB config information in its constructor, rather than reading it from django.conf.settings on-demand.  This was a problem because we change stuff in django.conf.settings on the fly to do our fancy test DB stuff -- basically, we initialize a SQLite DB once, copy it off, and then copy it between test cases, rather than clearing and reconstructing the initial DB.  I did measurements and it turns out all that jazz wasn't really saving us much time at all, so I just got rid of it all.  Django's testing stuff has improved and v1.1 even has some new tricks for using transactions to accomplish the above with a dramatic speedup, so we ought to look into using that in the future.

Signed-off-by: Steve Howard <showard@google.com>


git-svn-id: http://test.kernel.org/svn/autotest/trunk@4041 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/scheduler/monitor_db_unittest.py b/scheduler/monitor_db_unittest.py
index 4fa2aba..4f5f472 100755
--- a/scheduler/monitor_db_unittest.py
+++ b/scheduler/monitor_db_unittest.py
@@ -14,6 +14,7 @@
 from autotest_lib.frontend.afe import models
 from autotest_lib.scheduler import monitor_db, drone_manager, email_manager
 from autotest_lib.scheduler import scheduler_config, gc_stats
+from autotest_lib.scheduler import monitor_db_functional_test
 
 _DEBUG = False
 
@@ -91,14 +92,16 @@
         monitor_db.DBObject._clear_instance_cache()
 
         self._database = (
-            database_connection.DatabaseConnection.get_test_database(
-                self._test_db_file))
-        self._database.connect()
+            database_connection.TranslatingDatabase.get_test_database(
+                translators=monitor_db_functional_test._DB_TRANSLATORS))
+        self._database.connect(db_type='django')
         self._database.debug = _DEBUG
 
-        monitor_db._db = self._database
-        monitor_db._drone_manager._results_dir = '/test/path'
-        monitor_db._drone_manager._temporary_directory = '/test/path/tmp'
+        self.god.stub_with(monitor_db, '_db', self._database)
+        self.god.stub_with(monitor_db._drone_manager, '_results_dir',
+                           '/test/path')
+        self.god.stub_with(monitor_db._drone_manager, '_temporary_directory',
+                           '/test/path/tmp')
 
 
     def setUp(self):