MCPcopy Index your code
hub / github.com/MongoEngine/mongoengine / test_to_dbref

Method test_to_dbref

tests/document/test_instance.py:424–430  ·  view source on GitHub ↗

Ensure that you can get a dbref of a document.

(self)

Source from the content-addressed store, hash-verified

422 assert MyDocument.objects.count() == 1
423
424 def test_to_dbref(self):
425 """Ensure that you can get a dbref of a document."""
426 person = self.Person(name="Test User", age=30)
427 with pytest.raises(OperationError):
428 person.to_dbref()
429 person.save()
430 person.to_dbref()
431
432 def test_key_like_attribute_access(self):
433 person = self.Person(age=30)

Callers

nothing calls this directly

Calls 2

to_dbrefMethod · 0.80
saveMethod · 0.45

Tested by

no test coverage detected