summaryrefslogtreecommitdiff
path: root/tests/modeltests/basic
diff options
context:
space:
mode:
authorRussell Keith-Magee <russell@keith-magee.com>2006-08-27 13:59:47 +0000
committerRussell Keith-Magee <russell@keith-magee.com>2006-08-27 13:59:47 +0000
commit97b9ad73b4889ffebb3da2239b472bbfd1600177 (patch)
tree89acb1efa72ac38c1fc66709ef1f4e108876f10f /tests/modeltests/basic
parent77ab11be452d2da50925d5d2e3eed1b96ba7eca0 (diff)
Refs #2333 - Modified runtests script to use new testing framework. Migrated existing tests to use Django testing framework. All the 'othertests' have been migrated into 'regressiontests', and converted into doctests/unittests, as appropriate.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3661 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/modeltests/basic')
-rw-r--r--tests/modeltests/basic/models.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/tests/modeltests/basic/models.py b/tests/modeltests/basic/models.py
index 78d943eb97..acbea0d1e0 100644
--- a/tests/modeltests/basic/models.py
+++ b/tests/modeltests/basic/models.py
@@ -13,8 +13,7 @@ class Article(models.Model):
def __str__(self):
return self.headline
-API_TESTS = """
-
+__test__ = {'API_TESTS': """
# No articles are in the system yet.
>>> Article.objects.all()
[]
@@ -314,14 +313,14 @@ AttributeError: Manager isn't accessible via Article instances
>>> Article.objects.all()
[<Article: Article 6>, <Article: Default headline>, <Article: Article 7>, <Article: Updated article 8>]
-"""
+"""}
from django.conf import settings
building_docs = getattr(settings, 'BUILDING_DOCS', False)
if building_docs or settings.DATABASE_ENGINE == 'postgresql':
- API_TESTS += """
+ __test__['API_TESTS'] += """
# In PostgreSQL, microsecond-level precision is available.
>>> a9 = Article(headline='Article 9', pub_date=datetime(2005, 7, 31, 12, 30, 45, 180))
>>> a9.save()
@@ -330,7 +329,7 @@ datetime.datetime(2005, 7, 31, 12, 30, 45, 180)
"""
if building_docs or settings.DATABASE_ENGINE == 'mysql':
- API_TESTS += """
+ __test__['API_TESTS'] += """
# In MySQL, microsecond-level precision isn't available. You'll lose
# microsecond-level precision once the data is saved.
>>> a9 = Article(headline='Article 9', pub_date=datetime(2005, 7, 31, 12, 30, 45, 180))
@@ -339,7 +338,7 @@ if building_docs or settings.DATABASE_ENGINE == 'mysql':
datetime.datetime(2005, 7, 31, 12, 30, 45)
"""
-API_TESTS += """
+__test__['API_TESTS'] += """
# You can manually specify the primary key when creating a new object.
>>> a101 = Article(id=101, headline='Article 101', pub_date=datetime(2005, 7, 31, 12, 30, 45))