我正在尝试在Django中运行单元测试,它会创建一个新的数据库.数据库有postgis扩展,当我经常创建数据库时,我使用"CREATE ExTENSION postgis".
但是,当我运行测试时,它会给我以下错误:
$ ./manage.py test
Creating test database for alias 'default'...
Got an error creating the test database: database "test_project" already exists
Type 'yes' if you would like to try deleting the test database 'test_project', or 'no' to cancel: yes
Destroying old test database 'default'...
DatabaseError: permission denied to create extension "postgis"
HINT: Must be superuser to create this extension.
Run Code Online (Sandbox Code Playgroud)
用户已经具有Create DB权限,我在Ubuntu 12.04上使用Postgis 2.0使用PostgreSQL 9.1.