开发者

How do i create unittest in pyramid with mongodb?

开发者 https://www.devze.com 2023-03-16 05:44 出处:网络
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?

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

精彩评论

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