MCPcopy Index your code
hub / github.com/mongodb/mongo-python-driver / setUp

Method setUp

test/test_bulk.py:786–801  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

784 @client_context.require_auth
785 @client_context.require_no_api_version
786 def setUp(self):
787 super().setUp()
788 client_context.create_user(self.db.name, "readonly", "pw", ["read"])
789 self.db.command(
790 "createRole",
791 "noremove",
792 privileges=[
793 {
794 "actions": ["insert", "update", "find"],
795 "resource": {"db": "pymongo_test", "collection": "test"},
796 }
797 ],
798 roles=[],
799 )
800
801 client_context.create_user(self.db.name, "noremove", "pw", ["noremove"])
802
803 def tearDown(self):
804 self.db.command("dropRole", "noremove")

Callers

nothing calls this directly

Calls 3

setUpMethod · 0.45
create_userMethod · 0.45
commandMethod · 0.45

Tested by

no test coverage detected