Index: basic/models.py
===================================================================
--- basic/models.py	(revision 3316)
+++ basic/models.py	(working copy)
@@ -13,8 +13,7 @@
     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 @@
 >>> 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 @@
 """
 
 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 @@
 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))
Index: m2m_recursive/models.py
===================================================================
--- m2m_recursive/models.py	(revision 3316)
+++ m2m_recursive/models.py	(working copy)
@@ -22,7 +22,7 @@
     def __str__(self):
         return self.name
 
-API_TESTS = """
+__test__ = {'API_TESTS':"""
 >>> a = Person(name='Anne')
 >>> a.save()
 >>> b = Person(name='Bill')
@@ -189,4 +189,4 @@
 >>> d.stalkers.all()
 [<Person: Chuck>]
 
-"""
+"""}
Index: one_to_one/models.py
===================================================================
--- one_to_one/models.py	(revision 3316)
+++ one_to_one/models.py	(working copy)
@@ -30,7 +30,7 @@
     def __str__(self):
         return "%s the waiter at %s" % (self.name, self.restaurant)
 
-API_TESTS = """
+__test__ = {'API_TESTS':"""
 # Create a couple of Places.
 >>> p1 = Place(name='Demon Dogs', address='944 W. Fullerton')
 >>> p1.save()
@@ -151,4 +151,4 @@
 # Delete the restaurant; the waiter should also be removed
 >>> r = Restaurant.objects.get(pk=1)
 >>> r.delete()
-"""
+"""}
Index: m2o_recursive/models.py
===================================================================
--- m2o_recursive/models.py	(revision 3316)
+++ m2o_recursive/models.py	(working copy)
@@ -19,7 +19,7 @@
     def __str__(self):
         return self.name
 
-API_TESTS = """
+__test__ = {'API_TESTS':"""
 # Create a few Category objects.
 >>> r = Category(id=None, name='Root category', parent=None)
 >>> r.save()
@@ -37,4 +37,4 @@
 []
 >>> c.parent
 <Category: Root category>
-"""
+"""}
Index: custom_managers/models.py
===================================================================
--- custom_managers/models.py	(revision 3316)
+++ custom_managers/models.py	(working copy)
@@ -58,7 +58,7 @@
     def __str__(self):
         return self.name
 
-API_TESTS = """
+__test__ = {'API_TESTS':"""
 >>> p1 = Person(first_name='Bugs', last_name='Bunny', fun=True)
 >>> p1.save()
 >>> p2 = Person(first_name='Droopy', last_name='Dog', fun=False)
@@ -104,4 +104,4 @@
 # to the first manager defined in the class. In this case, it's "cars".
 >>> Car._default_manager.order_by('name')
 [<Car: Corvette>, <Car: Neon>]
-"""
+"""}
Index: invalid_models/models.py
===================================================================
--- invalid_models/models.py	(revision 3316)
+++ invalid_models/models.py	(working copy)
@@ -78,7 +78,7 @@
 
 
 
-error_log = """invalid_models.fielderrors: "charfield": CharFields require a "maxlength" attribute.
+model_errors = """invalid_models.fielderrors: "charfield": CharFields require a "maxlength" attribute.
 invalid_models.fielderrors: "floatfield": FloatFields require a "decimal_places" attribute.
 invalid_models.fielderrors: "floatfield": FloatFields require a "max_digits" attribute.
 invalid_models.fielderrors: "filefield": FileFields require an "upload_to" attribute.
Index: many_to_many/models.py
===================================================================
--- many_to_many/models.py	(revision 3316)
+++ many_to_many/models.py	(working copy)
@@ -28,7 +28,7 @@
     class Meta:
         ordering = ('headline',)
 
-API_TESTS = """
+__test__ = {'API_TESTS':"""
 # Create a couple of Publications.
 >>> p1 = Publication(id=None, title='The Python Journal')
 >>> p1.save()
@@ -231,4 +231,4 @@
 >>> p1.article_set.all()
 [<Article: NASA uses Python>]
 
-"""
+"""}
Index: m2m_and_m2o/models.py
===================================================================
--- m2m_and_m2o/models.py	(revision 3316)
+++ m2m_and_m2o/models.py	(working copy)
@@ -21,7 +21,7 @@
         ordering = ('num',)
 
 
-API_TESTS = """
+__test__ = {'API_TESTS':"""
 >>> Issue.objects.all()
 []
 >>> r = User(username='russell')
@@ -63,4 +63,4 @@
 [<Issue: 1>, <Issue: 2>, <Issue: 3>]
 >>> Issue.objects.filter(Q(client=r.id) | Q(cc__id__exact=r.id))
 [<Issue: 1>, <Issue: 2>, <Issue: 3>]
-"""
+"""}
Index: validation/models.py
===================================================================
--- validation/models.py	(revision 3316)
+++ validation/models.py	(working copy)
@@ -20,7 +20,7 @@
     def __str__(self):
         return self.name
 
-API_TESTS = """
+__test__ = {'API_TESTS':"""
 
 >>> import datetime
 >>> valid_params = {
@@ -146,4 +146,4 @@
 >>> p.validate()
 {'email': ['Enter a valid e-mail address.']}
 
-"""
+"""}
Index: or_lookups/models.py
===================================================================
--- or_lookups/models.py	(revision 3316)
+++ or_lookups/models.py	(working copy)
@@ -23,7 +23,7 @@
     def __str__(self):
         return self.headline
 
-API_TESTS = """
+__test__ = {'API_TESTS':"""
 >>> from datetime import datetime
 >>> from django.db.models import Q
 
@@ -101,4 +101,4 @@
 [<Article: Hello>]
 >>> Article.objects.complex_filter(Q(pk=1) | Q(pk=2))
 [<Article: Hello>, <Article: Goodbye>]
-"""
+"""}
Index: mutually_referential/models.py
===================================================================
--- mutually_referential/models.py	(revision 3316)
+++ mutually_referential/models.py	(working copy)
@@ -14,7 +14,7 @@
     name = CharField(maxlength=100)
     parent = ForeignKey(Parent)
 
-API_TESTS = """
+__test__ = {'API_TESTS':"""
 # Create a Parent
 >>> q = Parent(name='Elizabeth')
 >>> q.save()
@@ -29,4 +29,4 @@
 
 >>> q.delete()
 
-"""
\ No newline at end of file
+"""}
\ No newline at end of file
Index: custom_methods/models.py
===================================================================
--- custom_methods/models.py	(revision 3316)
+++ custom_methods/models.py	(working copy)
@@ -36,7 +36,7 @@
         # positional arguments to Article().
         return [self.__class__(*row) for row in cursor.fetchall()]
 
-API_TESTS = """
+__test__ = {'API_TESTS':"""
 # Create a couple of Articles.
 >>> from datetime import date
 >>> a = Article(id=None, headline='Area man programs in Python', pub_date=date(2005, 7, 27))
@@ -55,4 +55,4 @@
 [<Article: Area man programs in Python>]
 >>> b.articles_from_same_day_2()
 [<Article: Area man programs in Python>]
-"""
+"""}
Index: empty/models.py
===================================================================
--- empty/models.py	(revision 3316)
+++ empty/models.py	(working copy)
@@ -10,7 +10,7 @@
 class Empty(models.Model):
     pass
 
-API_TESTS = """
+__test__ = {'API_TESTS':"""
 >>> m = Empty()
 >>> m.id
 >>> m.save()
@@ -21,4 +21,4 @@
 >>> m.id is not None
 True
 
-"""
+"""}
Index: many_to_one_null/models.py
===================================================================
--- many_to_one_null/models.py	(revision 3316)
+++ many_to_one_null/models.py	(working copy)
@@ -23,7 +23,7 @@
     def __str__(self):
         return self.headline
 
-API_TESTS = """
+__test__ = {'API_TESTS':"""
 # Create a Reporter.
 >>> r = Reporter(name='John Smith')
 >>> r.save()
@@ -121,4 +121,4 @@
 >>> Article.objects.filter(reporter__isnull=True)
 [<Article: First>, <Article: Fourth>]
 
-"""
+"""}
Index: get_or_create/models.py
===================================================================
--- get_or_create/models.py	(revision 3316)
+++ get_or_create/models.py	(working copy)
@@ -15,7 +15,7 @@
     def __str__(self):
         return '%s %s' % (self.first_name, self.last_name)
 
-API_TESTS = """
+__test__ = {'API_TESTS':"""
 # Acting as a divine being, create an Person.
 >>> from datetime import date
 >>> p = Person(first_name='John', last_name='Lennon', birthday=date(1940, 10, 9))
@@ -49,4 +49,4 @@
 False
 >>> Person.objects.count()
 2
-"""
+"""}
Index: custom_pk/models.py
===================================================================
--- custom_pk/models.py	(revision 3316)
+++ custom_pk/models.py	(working copy)
@@ -27,7 +27,7 @@
     def __str__(self):
         return self.name
 
-API_TESTS = """
+__test__ = {'API_TESTS':"""
 >>> dan = Employee(employee_code='ABC123', first_name='Dan', last_name='Jones')
 >>> dan.save()
 >>> Employee.objects.all()
@@ -88,4 +88,4 @@
 >>> Business.objects.filter(employees__first_name__startswith='Fran')
 [<Business: Sears>]
 
-"""
+"""}
Index: reverse_lookup/models.py
===================================================================
--- reverse_lookup/models.py	(revision 3316)
+++ reverse_lookup/models.py	(working copy)
@@ -27,7 +27,7 @@
     def __str(self):
         return self.name
 
-API_TESTS = """
+__test__ = {'API_TESTS':"""
 >>> john = User(name="John Doe")
 >>> john.save()
 >>> jim = User(name="Jim Bo")
@@ -56,4 +56,4 @@
 Traceback (most recent call last):
     ...
 TypeError: Cannot resolve keyword 'choice' into field
-"""
+"""}
Index: m2o_recursive2/models.py
===================================================================
--- m2o_recursive2/models.py	(revision 3316)
+++ m2o_recursive2/models.py	(working copy)
@@ -17,7 +17,7 @@
     def __str__(self):
         return self.full_name
 
-API_TESTS = """
+__test__ = {'API_TESTS':"""
 # Create two Person objects -- the mom and dad in our family.
 >>> dad = Person(full_name='John Smith Senior', mother=None, father=None)
 >>> dad.save()
@@ -40,4 +40,4 @@
 []
 >>> kid.fathers_child_set.all()
 []
-"""
+"""}
Index: m2m_multiple/models.py
===================================================================
--- m2m_multiple/models.py	(revision 3316)
+++ m2m_multiple/models.py	(working copy)
@@ -28,7 +28,7 @@
     def __str__(self):
         return self.headline
 
-API_TESTS = """
+__test__ = {'API_TESTS':"""
 >>> from datetime import datetime
 
 >>> c1 = Category(name='Sports')
@@ -76,4 +76,4 @@
 []
 >>> c4.secondary_article_set.all()
 [<Article: Area man steals>, <Article: Area man runs>]
-"""
+"""}
Index: m2m_intermediary/models.py
===================================================================
--- m2m_intermediary/models.py	(revision 3316)
+++ m2m_intermediary/models.py	(working copy)
@@ -34,7 +34,7 @@
     def __str__(self):
         return '%s (%s)' % (self.reporter, self.position)
 
-API_TESTS = """
+__test__ = {'API_TESTS':"""
 # Create a few Reporters.
 >>> r1 = Reporter(first_name='John', last_name='Smith')
 >>> r1.save()
@@ -65,4 +65,4 @@
 <Article: This is a test>
 >>> r1.writer_set.all()
 [<Writer: John Smith (Main writer)>]
-"""
+"""}
Index: str/models.py
===================================================================
--- str/models.py	(revision 3316)
+++ str/models.py	(working copy)
@@ -17,7 +17,7 @@
     def __str__(self):
         return self.headline
 
-API_TESTS = """
+__test__ = {'API_TESTS':"""
 # Create an Article.
 >>> from datetime import datetime
 >>> a = Article(headline='Area man programs in Python', pub_date=datetime(2005, 7, 28))
@@ -28,4 +28,4 @@
 
 >>> a
 <Article: Area man programs in Python>
-"""
+"""}
Index: transactions/models.py
===================================================================
--- transactions/models.py	(revision 3316)
+++ transactions/models.py	(working copy)
@@ -17,16 +17,16 @@
     def __str__(self):
         return "%s %s" % (self.first_name, self.last_name)
 
-API_TESTS = """
+__test__ = {'API_TESTS':"""
 >>> from django.db import connection, transaction
-"""
+"""}
 
 from django.conf import settings
 
 building_docs = getattr(settings, 'BUILDING_DOCS', False)
 
 if building_docs or settings.DATABASE_ENGINE != 'mysql':
-    API_TESTS += """
+    __test__['API_TESTS'] += """
 # the default behavior is to autocommit after each save() action
 >>> def create_a_reporter_then_fail(first, last):
 ...     a = Reporter(first_name=first, last_name=last)
Index: model_inheritance/models.py
===================================================================
--- model_inheritance/models.py	(revision 3316)
+++ model_inheritance/models.py	(working copy)
@@ -26,7 +26,7 @@
     def __str__(self):
         return "%s the italian restaurant" % self.name
 
-API_TESTS = """
+__test__ = {'API_TESTS':"""
 # Make sure Restaurant has the right fields in the right order.
 >>> [f.name for f in Restaurant._meta.fields]
 ['id', 'name', 'address', 'serves_hot_dogs', 'serves_pizza']
@@ -50,4 +50,4 @@
 >>> ir.save()
 
 
-"""
+"""}
Index: lookup/models.py
===================================================================
--- lookup/models.py	(revision 3316)
+++ lookup/models.py	(working copy)
@@ -15,7 +15,7 @@
     def __str__(self):
         return self.headline
 
-API_TESTS = """
+__test__ = {'API_TESTS':"""
 # Create a couple of Articles.
 >>> from datetime import datetime
 >>> a1 = Article(headline='Article 1', pub_date=datetime(2005, 7, 26))
@@ -182,4 +182,4 @@
 [<Article: Article% with percent sign>, <Article: Article 5>, <Article: Article 6>, <Article: Article 4>, <Article: Article 2>, <Article: Article 3>, <Article: Article 7>, <Article: Article 1>]
 >>> Article.objects.exclude(headline="Article 7")
 [<Article: Article% with percent sign>, <Article: Article_ with underscore>, <Article: Article 5>, <Article: Article 6>, <Article: Article 4>, <Article: Article 2>, <Article: Article 3>, <Article: Article 1>]
-"""
+"""}
Index: choices/models.py
===================================================================
--- choices/models.py	(revision 3316)
+++ choices/models.py	(working copy)
@@ -23,7 +23,7 @@
     def __str__(self):
         return self.name
 
-API_TESTS = """
+__test__ = {'API_TESTS':"""
 >>> a = Person(name='Adrian', gender='M')
 >>> a.save()
 >>> s = Person(name='Sara', gender='F')
@@ -36,4 +36,4 @@
 'Male'
 >>> s.get_gender_display()
 'Female'
-"""
+"""}
Index: save_delete_hooks/models.py
===================================================================
--- save_delete_hooks/models.py	(revision 3316)
+++ save_delete_hooks/models.py	(working copy)
@@ -24,7 +24,7 @@
         super(Person, self).delete() # Call the "real" delete() method
         print "After deletion"
 
-API_TESTS = """
+__test__ = {'API_TESTS':"""
 >>> p1 = Person(first_name='John', last_name='Smith')
 >>> p1.save()
 Before save
@@ -39,4 +39,4 @@
 
 >>> Person.objects.all()
 []
-"""
+"""}
Index: pagination/models.py
===================================================================
--- pagination/models.py	(revision 3316)
+++ pagination/models.py	(working copy)
@@ -15,7 +15,7 @@
     def __str__(self):
         return self.headline
 
-API_TESTS = """
+__test__ = {'API_TESTS':"""
 # prepare a list of objects for pagination
 >>> from datetime import datetime
 >>> for x in range(1, 10):
@@ -64,4 +64,4 @@
 >>> paginator.last_on_page(1)
 9
 
-"""
+"""}
Index: get_latest/models.py
===================================================================
--- get_latest/models.py	(revision 3316)
+++ get_latest/models.py	(working copy)
@@ -29,7 +29,7 @@
     def __str__(self):
         return self.name
 
-API_TESTS = """
+__test__ = {'API_TESTS':"""
 # Because no Articles exist yet, get_latest() raises ArticleDoesNotExist.
 >>> Article.objects.latest()
 Traceback (most recent call last):
@@ -76,4 +76,4 @@
 
 >>> Person.objects.latest('birthday')
 <Person: Stephanie>
-"""
+"""}
Index: generic_relations/models.py
===================================================================
--- generic_relations/models.py	(revision 3316)
+++ generic_relations/models.py	(working copy)
@@ -53,7 +53,7 @@
     def __str__(self):
         return self.name
         
-API_TESTS = """
+__test__ = {'API_TESTS':"""
 # Create the world in 7 lines of code...
 >>> lion = Animal(common_name="Lion", latin_name="Panthera leo")
 >>> platypus = Animal(common_name="Platypus", latin_name="Ornithorhynchus anatinus")
@@ -105,4 +105,4 @@
 [<TaggedItem: shiny>]
 >>> TaggedItem.objects.filter(content_type__pk=ctype.id, object_id=quartz.id)
 [<TaggedItem: clearish>]
-"""
+"""}
Index: serializers/models.py
===================================================================
--- serializers/models.py	(revision 3316)
+++ serializers/models.py	(working copy)
@@ -37,7 +37,7 @@
     def __str__(self):
         return self.headline
 
-API_TESTS = """
+__test__ = {'API_TESTS':"""
 # Create some data:
 >>> from datetime import datetime
 >>> sports = Category(name="Sports")
@@ -118,4 +118,4 @@
 >>> Article.objects.all()
 [<Article: Just kidding; I love TV poker>, <Article: Time to reform copyright>]
 
-"""
+"""}
Index: properties/models.py
===================================================================
--- properties/models.py	(revision 3316)
+++ properties/models.py	(working copy)
@@ -20,7 +20,7 @@
 
     full_name_2 = property(_get_full_name, _set_full_name)
 
-API_TESTS = """
+__test__ = {'API_TESTS':"""
 >>> a = Person(first_name='John', last_name='Lennon')
 >>> a.save()
 >>> a.full_name
@@ -37,4 +37,4 @@
 >>> a2.save()
 >>> a2.first_name
 'Paul'
-"""
+"""}
Index: reserved_names/models.py
===================================================================
--- reserved_names/models.py	(revision 3316)
+++ reserved_names/models.py	(working copy)
@@ -24,7 +24,7 @@
     def __str__(self):
         return self.when
 
-API_TESTS = """
+__test__ = {'API_TESTS':"""
 >>> import datetime
 >>> day1 = datetime.date(2005, 1, 1)
 >>> day2 = datetime.date(2006, 2, 2)
@@ -53,4 +53,4 @@
 
 >>> Thing.objects.filter(where__month=1)
 [<Thing: a>]
-"""
+"""}
Index: many_to_one/models.py
===================================================================
--- many_to_one/models.py	(revision 3316)
+++ many_to_one/models.py	(working copy)
@@ -25,7 +25,7 @@
     class Meta:
         ordering = ('headline',)
 
-API_TESTS = """
+__test__ = {'API_TESTS':"""
 # Create a few Reporters.
 >>> r = Reporter(first_name='John', last_name='Smith', email='john@example.com')
 >>> r.save()
@@ -263,4 +263,4 @@
 >>> Article.objects.all()
 []
 
-"""
+"""}
Index: ordering/models.py
===================================================================
--- ordering/models.py	(revision 3316)
+++ ordering/models.py	(working copy)
@@ -24,7 +24,7 @@
     def __str__(self):
         return self.headline
 
-API_TESTS = """
+__test__ = {'API_TESTS':"""
 # Create a couple of Articles.
 >>> from datetime import datetime
 >>> a1 = Article(headline='Article 1', pub_date=datetime(2005, 7, 26))
@@ -64,4 +64,4 @@
 # don't know what order the output will be in.
 >>> Article.objects.order_by('?')
 [...]
-"""
+"""}
Index: custom_columns/models.py
===================================================================
--- custom_columns/models.py	(revision 3316)
+++ custom_columns/models.py	(working copy)
@@ -15,7 +15,7 @@
     def __str__(self):
         return '%s %s' % (self.first_name, self.last_name)
 
-API_TESTS = """
+__test__ = {'API_TESTS':"""
 # Create a Person.
 >>> p = Person(first_name='John', last_name='Smith')
 >>> p.save()
@@ -50,4 +50,4 @@
 Traceback (most recent call last):
     ...
 AttributeError: 'Person' object has no attribute 'last'
-"""
+"""}
Index: field_defaults/models.py
===================================================================
--- field_defaults/models.py	(revision 3316)
+++ field_defaults/models.py	(working copy)
@@ -19,7 +19,7 @@
     def __str__(self):
         return self.headline
 
-API_TESTS = """
+__test__ = {'API_TESTS':"""
 >>> from datetime import datetime
 
 # No articles are in the system yet.
@@ -48,4 +48,4 @@
 >>> d = now - a.pub_date
 >>> d.seconds < 5
 True
-"""
+"""}
Index: manipulators/models.py
===================================================================
--- manipulators/models.py	(revision 3316)
+++ manipulators/models.py	(working copy)
@@ -21,7 +21,7 @@
     def __str__(self):
         return self.name
 
-API_TESTS = """
+__test__ = {'API_TESTS':"""
 >>> from django.utils.datastructures import MultiValueDict
 
 # Create a Musician object via the default AddManipulator.
@@ -88,4 +88,4 @@
 <Album: Ultimate Ella>
 >>> a2.release_date
 datetime.date(2005, 2, 13)
-"""
+"""}
