Django全部验证测试错误-django.db.utils.OperationalError:没有这样的表:socialaccount_openidstore

Birophilo

有人可以帮助解决这个Django allauth问题吗?我在virtualenv中运行带有Python 3的Django 1.8。我已经在项目中安装了allauth,并且工作正常,但是尝试运行任何测试时出现错误消息。这是我可以得到的错误的最简单复制:

我创建一个新项目,然后下载django-allauth .zip文件,并将allauth目录复制到我的项目目录中。我在设置中将以下应用添加到INSTALLED_APPS:

'django.contrib.sites',
'allauth',
'allauth.account',
'allauth.socialaccount',
'allauth.socialaccount.providers.facebook',

然后运行python manage.py migrate到目前为止一切顺利,但是当我运行时python manage.py test,出现以下错误:

Traceback (most recent call last):
  File "/Users/AGG/Dropbox/env/lib/python3.4/site-packages/django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
  File "/Users/AGG/Dropbox/env/lib/python3.4/site-packages/django/db/backends/sqlite3/base.py", line 318, in execute
    return Database.Cursor.execute(self, query, params)
sqlite3.OperationalError: no such table: socialaccount_openidstore

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "./manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/Users/AGG/Dropbox/env/lib/python3.4/site-packages/django/core/management/__init__.py", line 338, in execute_from_command_line
    utility.execute()
  File "/Users/AGG/Dropbox/env/lib/python3.4/site-packages/django/core/management/__init__.py", line 330, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/Users/AGG/Dropbox/env/lib/python3.4/site-packages/django/core/management/commands/test.py", line 30, in run_from_argv
    super(Command, self).run_from_argv(argv)
  File "/Users/AGG/Dropbox/env/lib/python3.4/site-packages/django/core/management/base.py", line 390, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/Users/AGG/Dropbox/env/lib/python3.4/site-packages/django/core/management/commands/test.py", line 74, in execute
    super(Command, self).execute(*args, **options)
  File "/Users/AGG/Dropbox/env/lib/python3.4/site-packages/django/core/management/base.py", line 441, in execute
    output = self.handle(*args, **options)
  File "/Users/AGG/Dropbox/env/lib/python3.4/site-packages/django/core/management/commands/test.py", line 90, in handle
    failures = test_runner.run_tests(test_labels)
  File "/Users/AGG/Dropbox/env/lib/python3.4/site-packages/django/test/runner.py", line 210, in run_tests
    old_config = self.setup_databases()
  File "/Users/AGG/Dropbox/env/lib/python3.4/site-packages/django/test/runner.py", line 166, in setup_databases
    **kwargs
  File "/Users/AGG/Dropbox/env/lib/python3.4/site-packages/django/test/runner.py", line 370, in setup_databases
    serialize=connection.settings_dict.get("TEST", {}).get("SERIALIZE", True),
  File "/Users/AGG/Dropbox/env/lib/python3.4/site-packages/django/db/backends/base/creation.py", line 376, in create_test_db
    self.connection._test_serialized_contents = self.serialize_db_to_string()
  File "/Users/AGG/Dropbox/env/lib/python3.4/site-packages/django/db/backends/base/creation.py", line 413, in serialize_db_to_string
    serializers.serialize("json", get_objects(), indent=None, stream=out)
  File "/Users/AGG/Dropbox/env/lib/python3.4/site-packages/django/core/serializers/__init__.py", line 129, in serialize
    s.serialize(queryset, **options)
  File "/Users/AGG/Dropbox/env/lib/python3.4/site-packages/django/core/serializers/base.py", line 52, in serialize
    for obj in queryset:
  File "/Users/AGG/Dropbox/env/lib/python3.4/site-packages/django/db/backends/base/creation.py", line 409, in get_objects
    for obj in queryset.iterator():
  File "/Users/AGG/Dropbox/env/lib/python3.4/site-packages/django/db/models/query.py", line 238, in iterator
    results = compiler.execute_sql()
  File "/Users/AGG/Dropbox/env/lib/python3.4/site-packages/django/db/models/sql/compiler.py", line 829, in execute_sql
    cursor.execute(sql, params)
  File "/Users/AGG/Dropbox/env/lib/python3.4/site-packages/django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
  File "/Users/AGG/Dropbox/env/lib/python3.4/site-packages/django/db/utils.py", line 97, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "/Users/AGG/Dropbox/env/lib/python3.4/site-packages/django/utils/six.py", line 658, in reraise
    raise value.with_traceback(tb)
  File "/Users/AGG/Dropbox/env/lib/python3.4/site-packages/django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
  File "/Users/AGG/Dropbox/env/lib/python3.4/site-packages/django/db/backends/sqlite3/base.py", line 318, in execute
    return Database.Cursor.execute(self, query, params)
django.db.utils.OperationalError: no such table: socialaccount_openidstore

我尝试删除数据库或项目,然后重新开始。我在StackOverflow的其他地方找不到此问题。额外信息:如果我删除allauth中的测试文件或'allauth.socialaccount'在INSTALLED_APPS中将其注释掉,该错误就会消失我对“ openidstore”表非常困惑-这与allauth / socialaccount / providers / openid中的迁移有关吗?

托德
  1. 将'allauth.socialaccount.providers.openid'添加到INSTALLED_APPS
  2. manage.py makemigrations
  3. manage.py迁移

那为我解决了。

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

Related 相关文章

热门标签

归档