Author: kmtracey
Date: 2010-09-10 14:19:08 -0500 (Fri, 10 Sep 2010)
New Revision: 13718

Modified:
   django/branches/releases/1.2.X/
   
django/branches/releases/1.2.X/tests/modeltests/fixtures_model_package/tests.py
Log:
[1.2.X] Pass commit=False to loaddata in tests, which will keep the DB 
connection open. Closing the connection has the side-effect on some DBs 
(Postgres, MySQL/InnoDB) of rolling back the transaction that was in progress, 
causing these tests to fail. 

r13717 from trunk.



Property changes on: django/branches/releases/1.2.X
___________________________________________________________________
Name: svnmerge-integrated
   - 
/django/trunk:1-13360,13434,13480,13574,13600,13638,13652,13664,13666,13668,13680,13683,13685,13687-13688,13690,13694,13696,13701-13702,13705,13709,13712,13715
   + 
/django/trunk:1-13360,13434,13480,13574,13600,13638,13652,13664,13666,13668,13680,13683,13685,13687-13688,13690,13694,13696,13701-13702,13705,13709,13712,13715,13717

Modified: 
django/branches/releases/1.2.X/tests/modeltests/fixtures_model_package/tests.py
===================================================================
--- 
django/branches/releases/1.2.X/tests/modeltests/fixtures_model_package/tests.py 
    2010-09-10 19:16:43 UTC (rev 13717)
+++ 
django/branches/releases/1.2.X/tests/modeltests/fixtures_model_package/tests.py 
    2010-09-10 19:19:08 UTC (rev 13718)
@@ -35,7 +35,7 @@
     def test_loaddata(self):
         "Fixtures can load data into models defined in packages"
         # Load fixture 1. Single JSON file, with two objects
-        management.call_command("loaddata", "fixture1.json", verbosity=0)
+        management.call_command("loaddata", "fixture1.json", verbosity=0, 
commit=False)
         self.assertQuerysetEqual(
             Article.objects.all(), [
                 "Time to reform copyright",
@@ -47,7 +47,7 @@
 
         # Load fixture 2. JSON file imported by default. Overwrites some
         # existing objects
-        management.call_command("loaddata", "fixture2.json", verbosity=0)
+        management.call_command("loaddata", "fixture2.json", verbosity=0, 
commit=False)
         self.assertQuerysetEqual(
             Article.objects.all(), [
                 "Django conquers world!",
@@ -59,7 +59,7 @@
         )
 
         # Load a fixture that doesn't exist
-        management.call_command("loaddata", "unknown.json", verbosity=0)
+        management.call_command("loaddata", "unknown.json", verbosity=0, 
commit=False)
         self.assertQuerysetEqual(
             Article.objects.all(), [
                 "Django conquers world!",

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to