![]() I am thinking of keeping some fake data like this, just do not know how to properly deal with it. Just do I need an external tool to do so? ![]() ![]() I think I need to create some fixtures per models that are in my memory and work with them. To test this, I do not really want a test mongodb up and running! But also, I think I do not want to mock db.userssave and db.users.find because I want to actually be able to retrieve the data that I saved and make sure it is in the db. In another article, we set up a MongoDB Atlas account and also completed some basic exercises in Mongo DB, such as creating a database, creating a collection and inserting some documents as well. You can vote up the ones you like or vote down the ones you dont like, and go to the original project or source file by following the links above each example. Code to Test from pymongo import MongoClient In this article, we are going to develop an interaction between Python and MongoDB. The following are 30 code examples for showing how to use pymongo.MongoClient().These examples are extracted from open source projects. So appreciate if you could provide an example or tutorial on this. I am just a bit lost in thinking of is there a way to write a mock for a module (like pymongo), or anything is achievable by mock module. All I want is some tempo data and being able to call pymongo functionality. I do not think I want to have a test mongodb instance running. I am wondering if mocking the MongoDB is different than using mock functionality ( mock.patch a function that is being called?) Or I need to use another different package for that purpose? I am using mock module for Python 2.7 to mock my other functions and using
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |