catmaid主分支笔记

来源:互联网 发布:购买的域名如何使用 编辑:程序博客网 时间:2024/06/05 10:24

从catmaid官网入手
catmaid官网地址:
https://catmaid.readthedocs.io/en/stable/
看官网文档
在Documentation
Developer Documentation
Django Unit Tests for CATMAID
中,
运行测试

./manage.py test

出现下面错误

    connection = Database.connect(**conn_params)  File "/home/hhb/.virtualenvs/catmaid/local/lib/python2.7/site-packages/psycopg2/__init__.py", line 164, in connect    conn = _connect(dsn, connection_factory=connection_factory, async=async)django.db.utils.OperationalError: FATAL:  Peer authentication failed for user "catmaid_user"(catmaid)hhb@ubuntu:~/work/CATMAID-master/django/projects/mysite$ 

可以看到应该是连接数据库时,认证错误

解决该错误的参考来源:
Django connection to PostgreSQL: “Peer authentication failed”

修改pg_hba.conf文件
添加

local   all         all                               trust

再次执行:

./manage.py test

输出

(catmaid)hhb@ubuntu:~/work/CATMAID-master/django/projects/mysite$ ./manage.py testNo handlers could be found for logger "custom_postgresql_psycopg2"Creating test database for alias 'default'...Got an error creating the test database: database "test_catmaid" already existsType 'yes' if you would like to try deleting the test database 'test_catmaid', or 'no' to cancel: yesDestroying old test database for alias 'default'...INFO 2016-10-17 10:59:33,845 Creating ontology dummy project----------------------------------------------------------------------Ran 0 tests in 0.000sOKDestroying test database for alias 'default'...(catmaid)hhb@ubuntu:~/work/CATMAID-master/django/projects/mysite$ ./manage.py testNo handlers could be found for logger "custom_postgresql_psycopg2"Creating test database for alias 'default'...INFO 2016-10-17 11:02:46,536 Creating ontology dummy project----------------------------------------------------------------------Ran 0 tests in 0.000sOKDestroying test database for alias 'default'...(catmaid)hhb@ubuntu:~/work/CATMAID-master/django/projects/mysite$

可以看到,应该是可以正常跑测试

0 0
原创粉丝点击