(self)
| 467 | ) |
| 468 | |
| 469 | def test_id_ordering(self): |
| 470 | # PyMongo attempts to have _id show up first |
| 471 | # when you iterate key/value pairs in a document. |
| 472 | # This isn't reliable since python dicts don't |
| 473 | # guarantee any particular order. This will never |
| 474 | # work right in any Python or environment |
| 475 | # with hash randomization enabled (e.g. tox). |
| 476 | db = self.client.pymongo_test |
| 477 | db.test.drop() |
| 478 | db.test.insert_one(SON([("hello", "world"), ("_id", 5)])) |
| 479 | |
| 480 | db = self.client.get_database( |
| 481 | "pymongo_test", codec_options=CodecOptions(document_class=SON[str, Any]) |
| 482 | ) |
| 483 | cursor = db.test.find() |
| 484 | for x in cursor: |
| 485 | for k, _v in x.items(): |
| 486 | self.assertEqual(k, "_id") |
| 487 | break |
| 488 | |
| 489 | def test_deref(self): |
| 490 | db = self.client.pymongo_test |
nothing calls this directly
no test coverage detected