0

根据文档,我可以像这样为 django.contrib.admin 运行测试

# from django/tests
./runtests.py --settings=test_sqlite django.contrib.admin

但是,当我这样做时,我收到此错误:

  Traceback (most recent call last):
  File "./runtests.py", line 337, in <module>
    options.failfast, args)
  File "./runtests.py", line 180, in django_tests
    failures = test_runner.run_tests(test_labels, extra_tests=extra_tests)
  File "/Users/joshuafialkoff/.virtualenvs/bankr-env/src/django/django/test/simple.py", line 369, in run_tests
    suite = self.build_suite(test_labels, extra_tests)
  File "/Users/joshuafialkoff/.virtualenvs/bankr-env/src/django/django/test/simple.py", line 254, in build_suite
    suite.addTest(build_test(label))
  File "/Users/joshuafialkoff/.virtualenvs/bankr-env/src/django/django/test/simple.py", line 102, in build_test
    app_module = get_app(parts[0])
  File "/Users/joshuafialkoff/.virtualenvs/bankr-env/src/django/django/db/models/loading.py", line 160, in get_app
    raise ImproperlyConfigured("App with label %s could not be found" % app_label)
django.core.exceptions.ImproperlyConfigured: App with label django could not be found

同时,如果我运行:

./runtests.py --settings=test_sqlite

测试开始运行 - 但我不想运行整个套件。我从 repo 标签 1.5.2 运行它。我该如何为管理员运行测试?

4

0 回答 0