From ab60fd0490dc6b071973a344b7f4ddb23f7d2e84 Mon Sep 17 00:00:00 2001 From: Dmitry Balabanov Date: Thu, 30 Aug 2012 14:37:11 +0400 Subject: [PATCH] sharded collection document reload testcase --- tests/test_document.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/test_document.py b/tests/test_document.py index 6915caff..a551040b 100644 --- a/tests/test_document.py +++ b/tests/test_document.py @@ -1226,6 +1226,17 @@ class DocumentTest(unittest.TestCase): self.assertEqual(person.name, "Mr Test User") self.assertEqual(person.age, 21) + def test_reload_sharded(self): + class Animal(Document): + superphylum = StringField() + meta = {'shard_key': ('superphylum',)} + + Animal.drop_collection() + doc = Animal(superphylum = 'Deuterostomia') + doc.save() + doc.reload() + Animal.drop_collection() + def test_reload_referencing(self): """Ensures reloading updates weakrefs correctly """