Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorBenjamin Saller <bcsaller@objectrealms.net>2007-07-16 22:47:36 (GMT)
committer Benjamin Saller <bcsaller@objectrealms.net>2007-07-16 22:47:36 (GMT)
commitd26583e7d16cc3d91dfd58f8dced8969a5425d64 (patch)
treea76dcb501ca64b6eb7912505501774e1fd402229 /tests
parentd750a77ffeb6da5ecd61824f7a8653b0c0ba68e9 (diff)
relax model restriction by defaulting new keys as strings or recording their types
Diffstat (limited to 'tests')
-rw-r--r--tests/test_model.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/test_model.py b/tests/test_model.py
index dc49dac..618c5cb 100644
--- a/tests/test_model.py
+++ b/tests/test_model.py
@@ -92,6 +92,30 @@ class Test(unittest.TestCase):
c = ds.get(uid)
assert c.get_property('keep') == 0
+ ds.stop()
+
+ def test_randomproperty(self):
+ # specifying items not in the model, with and w/o type
+ # qualifiers
+ ds = DataStore()
+ ds.registerBackend(backingstore.FileBackingStore)
+
+ ds.mount(DEFAULT_STORE)
+
+ uid = ds.create({'title' : 'Random Extras', 'foobar' : 'baz',
+ 'incept:date' : datetime.datetime.now().isoformat()})
+
+ ds.complete_indexing()
+
+ ds.update(uid, {'title' : 'Random Extras the sequel', 'foobar' : 'whodofoodo',
+ 'incept:date' : datetime.datetime.now().isoformat()})
+
+ ds.complete_indexing()
+
+ assert ds.find('whodofoodo')[1] == 1
+
+ ds.stop()
+
def test_suite():
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(Test))