benoitc/couchdbkit — Issue #119: Buggy SchemaDictProperty
Author: sirex
Created: 2012-02-16 19:44:25+00:00
State: open

Here is patch to tests, that demonstrates, how to reprodice this bug:

diff --git a/tests/test_schema.py b/tests/test_schema.py
index d141ebf..f7c8058 100644
--- a/tests/test_schema.py
+++ b/tests/test_schema.py
@@ -1353,6 +1353,10 @@ class PropertyTestCase(unittest.TestCase):
self.assert_(b1.d['v1'].i == 123)
self.assert_(b1.d[23].i == 42)

+ b1.d = {23: {'i': 321}}
+ b1.set_db(self.db)
+ b1.save()
+

def testListProperty(self):
from datetime import datetime

This bug only occurs, when trying to assign dictionary to bounded object. When
I try to do this on new object, everything works ok.