MCPcopy Create free account
hub / github.com/mongodb/mongo-python-driver / test_deref_kwargs

Method test_deref_kwargs

test/test_database.py:513–523  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

511 self.assertEqual(obj, db.dereference(DBRef("test", 4)))
512
513 def test_deref_kwargs(self):
514 db = self.client.pymongo_test
515 db.test.drop()
516
517 db.test.insert_one({"_id": 4, "foo": "bar"})
518 db = self.client.get_database(
519 "pymongo_test", codec_options=CodecOptions(document_class=SON[str, Any])
520 )
521 self.assertEqual(
522 SON([("foo", "bar")]), db.dereference(DBRef("test", 4), projection={"_id": False})
523 )
524
525 # TODO some of these tests belong in the collection level testing.
526 def test_insert_find_one(self):

Callers

nothing calls this directly

Calls 7

CodecOptionsClass · 0.90
SONClass · 0.90
DBRefClass · 0.90
dropMethod · 0.45
insert_oneMethod · 0.45
get_databaseMethod · 0.45
dereferenceMethod · 0.45

Tested by

no test coverage detected