繁体   English   中英

从django-social-auth导入测试时的Python导入错误

[英]Python Import Error when importing tests from django-social-auth

我正在尝试从django-social-auth包中子类化一些类以创建自定义测试。

来源https://github.com/omab/django-social-auth

问题是我无法导入“测试”部分:

C:\Users\Alle>python
Python 2.6.6 (r266:84297, Aug 24 2010, 18:46:32) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import social_auth.tests.base
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named tests.base
>>> import social_auth.tests
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named tests
>>> import social_auth.db
>>> social_auth.db
<module 'social_auth.db' from 'C:\Python26\lib\site-packages\social_auth\db\__init__.pyc'>
>>>

为什么我会得到这种行为?

默认情况下未安装测试

来自social_auth setup.py

  packages=['social_auth',
            'social_auth.management',
            'social_auth.management.commands',
            'social_auth.backends',
            'social_auth.backends.contrib',
            'social_auth.backends.pipeline',
            'social_auth.migrations',
            'social_auth.db'],

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM