Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Select file from which to insert content to collection #18

Open
alexgawrilow opened this issue Aug 30, 2019 · 0 comments
Open

Select file from which to insert content to collection #18

alexgawrilow opened this issue Aug 30, 2019 · 0 comments

Comments

@alexgawrilow
Copy link

Not sure if I'm using the package correctly.
I have a use case where I want to test several functionality on the same collection of the database. I find it useful for each test to populate the same collection with different data, separately. For this I have some test functions (test_1, test_2 and test_3) and appropriate data in files data_for_test_1.json, data_for_test_2.json and data_for_test_3.json, so that each file contains tailored data for the appropriate test case. I want the same collection of the mongodb fixture to contain different data, based on the test case. Is there an easy way to achieve this or is this even an intended use case? From the documentation I read:

The collection that these documents are being inserted into is given by the filename of your fixture-file.

I wrote another fixture that uses the load_fixture function from the package with optional collection and file name that creates an empty data base and populates the given collection with the data from the given file.
Do you think this is intended and useful for other users, as well? I could implement it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant