开发者

How do i create unittest in pyramid with mongodb?

I have a py开发者_如何转开发ramid project that uses mongodb for storage. Now I'm trying to write a test but how do I specify connection to the mongodb?

More specifically, which database should I connect to (test?) and how do I use fixtures? In Django it creates a temporary database but how does it work in pyramid?


Just create a database in your TestCase.setUp and delete in TestCase.tearDown

You need mongodb running because there is no mongolite3 like sqlite3 for sql

I doubt that django is able to create a temporary file to store a mongodb database. It probably just use sqlite:/// which create a database with a memory storage.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜