我刚刚开始使用 Nose 和 Nosetests,我的测试失败了,因为 Nose 看不到环境变量。
到目前为止,错误: AttributeError: 'Settings' object has no attribute 'DJANGO_SETTINGS_MODULE'
我通过从 .bash_profile 导出 DJANGO_SETTINGS_MODULE 解决了这个问题
export DJANGO_SETTINGS_MODULE="settings"
现在我看到:
AttributeError: 'Settings' object has no attribute 'DATABASE_SUPPORTS_TRANSACTIONS'
为什么 iPython 和 Django 网络服务器能够看到这些 ENV 变量,而 Nose 却不能?