1. Mike Mazur
  2. nose-django


Victor Ng  committed dfba3a3

Comments re: DEBUG and database flushing

  • Participants
  • Parent commits 8d0793b
  • Branches default

Comments (0)

Files changed (1)

File nosedjango/nosedjango.py

View file
         import settings
-        settings.DEBUG = False # I have no idea why Django does this, but it does
+        # Some Django code paths evaluate differently
+        # between DEBUG and not DEBUG.  Example of this include the url
+        # dispatcher when 404's are hit.  Django's own test runner forces DEBUG
+        # to be off.
+        settings.DEBUG = False 
         from django.core import mail
         self.mail = mail
         from django.conf import settings
             # short circuit if no settings file can be found
+        # This is a distinctive difference between the NoseDjango
+        # test runner compared to the plain Django test runner.
+        # Django uses the standard unittest framework and resets the 
+        # database between each test *suite*.  That usually resolves
+        # into a test module.
+        #
+        # The NoseDjango test runner will reset the database between *every*
+        # test case.  This is more in the spirit of unittesting where there is
+        # no state information passed between individual tests.
         from django.core.management import call_command
         call_command('flush', verbosity=0, interactive=False)