| 562 | self.fail("Failed to raise an exception.") |
| 563 | |
| 564 | def test_dbpointer(self): |
| 565 | # *Note* - DBPointer and DBRef are *not* the same thing. DBPointer |
| 566 | # is a deprecated BSON type. DBRef is a convention that does not |
| 567 | # exist in the BSON spec, meant to replace DBPointer. PyMongo does |
| 568 | # not support creation of the DBPointer type, but will decode |
| 569 | # DBPointer to DBRef. |
| 570 | |
| 571 | bs = b"\x18\x00\x00\x00\x0c\x00\x01\x00\x00\x00\x00RY\xb5j\xfa[\xd8A\xd6X]\x99\x00" |
| 572 | |
| 573 | self.assertEqual({"": DBRef("", ObjectId("5259b56afa5bd841d6585d99"))}, decode(bs)) |
| 574 | |
| 575 | def test_bad_dbref(self): |
| 576 | ref_only = {"ref": {"$ref": "collection"}} |