Added to_dbref

Thanks to Ankhbayar for the initial code
Closes #202
This commit is contained in:
Ross Lawley
2011-06-17 10:34:29 +01:00
parent 5e7efcc8c2
commit f3d265bbe0
2 changed files with 16 additions and 0 deletions

View File

@@ -777,6 +777,14 @@ class DocumentTest(unittest.TestCase):
self.assertEqual(person.name, "Test User")
self.assertEqual(person.age, 30)
def test_to_dbref(self):
"""Ensure that you can get a dbref of a document"""
person = self.Person(name="Test User", age=30)
self.assertRaises(OperationError, person.to_dbref)
person.save()
person.to_dbref()
def test_reload(self):
"""Ensure that attributes may be reloaded.
"""