您可以将-v 2传递给测试命令:
python manage.py test -v 2
运行这个命令后,你会得到这样的东西(我使用django 1.9,随意忽略迁移/数据库的东西):
Creating test database for alias 'default' (':memory:')...
Operations to perform:
Synchronize unmigrated apps: staticfiles, messages
Apply all migrations: admin, contenttypes, auth, sessions
Synchronizing apps without migrations:
Creating tables...
Running deferred SQL...
Running migrations:
Rendering model states... DONE
Applying contenttypes.0001_initial... OK
Applying auth.0001_initial... OK
Applying admin.0001_initial... OK
Applying admin.0002_logentry_remove_auto_add... OK
Applying contenttypes.0002_remove_content_type_name... OK
Applying auth.0002_alter_permission_name_max_length... OK
Applying auth.0003_alter_user_email_max_length... OK
Applying auth.0004_alter_user_username_opts... OK
Applying auth.0005_alter_user_last_login_null... OK
Applying auth.0006_require_contenttypes_0002... OK
Applying auth.0007_alter_validators_add_error_messages... OK
Applying sessions.0001_initial... OK
test_equal_hard (polls.tests.TestHard) ... ok
test_equal_simple (polls.tests.TestSimple) ... ok
|
|
That's your tests! >----------------------------+
顺便说一下,v代表verbosity(你也可以使用–verbosity = 2):
python manage.py test --verbosity=2
这里是从python manage.py –help摘录:
Options: -v VERBOSITY, –verbosity=VERBOSITY
Verbosity level; 0=minimal output, 1=normal output, 2=verbose output, 3=very verbose output