0
(数学空间)pzrq@Peters-Mac-mini:~/Projects/mathspace$ ./manage.py 测试
为别名 'default' (':memory:') 创建测试数据库...
回溯(最近一次通话最后):
  文件“./manage.py”,第 20 行,在
    execute_from_command_line(sys.argv)
  文件“/Users/pzrq/.virtualenvs/mathspace/lib/python2.7/site-packages/django/core/management/__init__.py”,第 338 行,在 execute_from_command_line
    实用程序.execute()
  文件“/Users/pzrq/.virtualenvs/mathspace/lib/python2.7/site-packages/django/core/management/__init__.py”,第330行,在执行
    self.fetch_command(子命令).run_from_argv(self.argv)
  文件“/Users/pzrq/.virtualenvs/mathspace/lib/python2.7/site-packages/django/core/management/commands/test.py”,第 30 行,在 run_from_argv
    超级(命令,自我).run_from_argv(argv)
  文件“/Users/pzrq/.virtualenvs/mathspace/lib/python2.7/site-packages/django/core/management/base.py”,第 390 行,在 run_from_argv
    self.execute(*args, **cmd_options)
  文件“/Users/pzrq/.virtualenvs/mathspace/lib/python2.7/site-packages/django/core/management/commands/test.py”,第74行,在执行
    super(Command, self).execute(*args, **options)
  文件“/Users/pzrq/.virtualenvs/mathspace/lib/python2.7/site-packages/django/core/management/base.py”,第 441 行,在执行
    输出 = self.handle(*args, **options)
  文件“/Users/pzrq/.virtualenvs/mathspace/lib/python2.7/site-packages/test_without_migrations/management/commands/test.py”,第 28 行,在句柄中
    super(Command, self).handle(*test_labels, **options)
  文件“/Users/pzrq/.virtualenvs/mathspace/lib/python2.7/site-packages/django/core/management/commands/test.py”,第 90 行,在句柄中
    失败 = test_runner.run_tests(test_labels)
  文件“/Users/pzrq/.virtualenvs/mathspace/lib/python2.7/site-packages/django/test/runner.py”,第 210 行,在 run_tests
    old_config = self.setup_databases()
  setup_databases 中的文件“/Users/pzrq/.virtualenvs/mathspace/lib/python2.7/site-packages/django/test/runner.py”,第 166 行
    **kwargs
  setup_databases 中的文件“/Users/pzrq/.virtualenvs/mathspace/lib/python2.7/site-packages/django/test/runner.py”,第 370 行
    serialize=connection.settings_dict.get("TEST", {}).get("SERIALIZE", True),
  文件“/Users/pzrq/.virtualenvs/mathspace/lib/python2.7/site-packages/django/db/backends/base/creation.py”,第 365 行,在 create_test_db
    详细度=最大(详细度 - 1, 0),
TypeError: 不支持的操作数类型 -: 'unicode' 和 'int'
4

1 回答 1

0

修复者:

pip uninstall django-test-without-migrations

我猜这是由于旧版本的django-test-without-migrations不尊重 Django 1.8 中的 optparse 到 argparse 更新,所以我后来确定你也可以通过以下方式修复它:

pip install --upgrade django-test-without-migrations
于 2015-04-27T11:13:33.617 回答