Author: mtredinnick
Date: 2007-09-16 05:04:03 -0500 (Sun, 16 Sep 2007)
New Revision: 6353
Modified:
django/trunk/tests/modeltests/fixtures/models.py
Log:
Removed the test portion that relies on transactions when the backend is mysql
or mysql_old (it's still in place for all other backends).
Modified: django/trunk/tests/modeltests/fixtures/models.py
===================================================================
--- django/trunk/tests/modeltests/fixtures/models.py 2007-09-16 04:38:20 UTC
(rev 6352)
+++ django/trunk/tests/modeltests/fixtures/models.py 2007-09-16 10:04:03 UTC
(rev 6353)
@@ -9,6 +9,7 @@
"""
from django.db import models
+from django.conf import settings
class Article(models.Model):
headline = models.CharField(max_length=100, default='Default headline')
@@ -53,7 +54,13 @@
# object list is unaffected
>>> Article.objects.all()
[<Article: XML identified as leading cause of cancer>, <Article: Django
conquers world!>, <Article: Copyright is fine the way it is>, <Article: Poker
on TV is great!>, <Article: Python program becomes self aware>]
+"""}
+# Database flushing does not work on MySQL with the default storage engine,
+# because it requires transaction spuport.
+if settings.DATABASE_ENGINE not in ('mysql', 'mysql_old'):
+ __test__['API_TESTS'] += \
+"""
# Reset the database representation of this app. This will delete all data.
>>> management.call_command('flush', verbosity=0, interactive=False)
>>> Article.objects.all()
@@ -75,7 +82,7 @@
# Dump the current contents of the database as a JSON fixture
>>> management.call_command('dumpdata', 'fixtures', format='json')
[{"pk": 3, "model": "fixtures.article", "fields": {"headline": "Time to reform
copyright", "pub_date": "2006-06-16 13:00:00"}}, {"pk": 2, "model":
"fixtures.article", "fields": {"headline": "Poker has no place on ESPN",
"pub_date": "2006-06-16 12:00:00"}}, {"pk": 1, "model": "fixtures.article",
"fields": {"headline": "Python program becomes self aware", "pub_date":
"2006-06-16 11:00:00"}}]
-"""}
+"""
from django.test import TestCase
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---