summaryrefslogtreecommitdiff
path: root/django/test/testcases.py
diff options
context:
space:
mode:
authorAdrian Holovaty <adrian@holovaty.com>2007-08-16 06:06:55 +0000
committerAdrian Holovaty <adrian@holovaty.com>2007-08-16 06:06:55 +0000
commit01adbb55e6698b512ff202bc5fc81f9565e4003b (patch)
tree9b9ab3f9fa4461665ff81546c840054a34c50d16 /django/test/testcases.py
parent7f06e44f9959fd8c0db58162d4bd5feb383db8f1 (diff)
Major refactoring of django.core.management -- it's now a package rather than a 1730-line single module. All django-admin/manage.py commands are now stored in separate modules. This is backwards-incompatible for people who used django.core.management functions directly
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5898 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/test/testcases.py')
-rw-r--r--django/test/testcases.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/django/test/testcases.py b/django/test/testcases.py
index 681ab3538f..21c429271c 100644
--- a/django/test/testcases.py
+++ b/django/test/testcases.py
@@ -1,7 +1,8 @@
import re, unittest
from urlparse import urlparse
from django.db import transaction
-from django.core import management, mail
+from django.core import mail
+from django.core.management import call_command
from django.db.models import get_apps
from django.test import _doctest as doctest
from django.test.client import Client
@@ -42,9 +43,11 @@ class TestCase(unittest.TestCase):
* Clearing the mail test outbox.
"""
- management.flush(verbosity=0, interactive=False)
+ call_command('flush', verbosity=0, interactive=False)
if hasattr(self, 'fixtures'):
- management.load_data(self.fixtures, verbosity=0)
+ # We have to use this slightly awkward syntax due to the fact
+ # that we're using *args and **kwargs together.
+ call_command('loaddata', *self.fixtures, **{'verbosity': 0})
mail.outbox = []
def __call__(self, result=None):