Index: tests/model_test.py |
=================================================================== |
--- tests/model_test.py (revision 226737) |
+++ tests/model_test.py (working copy) |
@@ -71,7 +71,7 @@ |
l = (Basic, dict) |
-class StrDisallowed(PersistentMixIn): |
+class StrAllowed(PersistentMixIn): |
m = str |
@@ -228,8 +228,13 @@ |
} |
self.assertEqual(expected, data.as_dict()) |
- def testStrDisallowed(self): |
- self.assertRaises(TypeError, StrDisallowed) |
+ def testStrAllowed(self): |
+ data = StrAllowed(m='foo') |
+ expected = { |
+ 'm': 'foo', |
+ TYPE_FLAG: 'StrAllowed', |
+ } |
+ self.assertEqual(expected, data.as_dict()) |
class Deserialize(Base): |
@@ -377,11 +382,13 @@ |
actual = PersistentMixIn.from_dict(marshall(data)) |
self._check(actual, TypeOrDict, l={'foo': 'bar'}) |
- def testStrDisallowed(self): |
+ def testStrAllowed(self): |
data = { |
- TYPE_FLAG: 'StrDisallowed', |
+ 'm': 'bar', |
+ TYPE_FLAG: 'StrAllowed', |
} |
- self.assertRaises(TypeError, PersistentMixIn.from_dict, marshall(data)) |
+ actual = PersistentMixIn.from_dict(marshall(StrAllowed(m='bar'))) |
+ self._check(actual, StrAllowed, m='bar') |
class Mutable(object): |