summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaren Tracey <kmtracey@gmail.com>2010-09-10 19:19:08 +0000
committerKaren Tracey <kmtracey@gmail.com>2010-09-10 19:19:08 +0000
commit924ae1a09c0e0fd470f9f80debe7466a193bb54d (patch)
treeda82f554a28f09b69d511bdc5495b7a1e8fd3389
parentec8d04cffe720477908c7668018102768eb43083 (diff)
[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. git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.2.X@13718 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r--tests/modeltests/fixtures_model_package/tests.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/modeltests/fixtures_model_package/tests.py b/tests/modeltests/fixtures_model_package/tests.py
index 328f8b8498..1fae5ee807 100644
--- a/tests/modeltests/fixtures_model_package/tests.py
+++ b/tests/modeltests/fixtures_model_package/tests.py
@@ -35,7 +35,7 @@ class FixtureTestCase(TestCase):
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 @@ class FixtureTestCase(TestCase):
# 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 @@ class FixtureTestCase(TestCase):
)
# 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!",