diff --git a/AUTHORS b/AUTHORS index 0332f12c..8af18138 100644 --- a/AUTHORS +++ b/AUTHORS @@ -68,3 +68,4 @@ that much better: * Albert Choi * John Arnfield * grubberr + * Paul Aliagas diff --git a/docs/changelog.rst b/docs/changelog.rst index 904eb200..b2ef802e 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -5,6 +5,7 @@ Changelog Changes in dev ============== +- Fixed ListField so it doesnt accept strings - Added DynamicDocument and EmbeddedDynamicDocument classes for expando schemas Changes in v0.5 diff --git a/tests/fields.py b/tests/fields.py index dc53eae3..fd993167 100644 --- a/tests/fields.py +++ b/tests/fields.py @@ -515,6 +515,20 @@ class FieldTest(unittest.TestCase): Simple.drop_collection() + + def test_list_field_rejects_strings(self): + """Strings aren't valid list field data types""" + + class Simple(Document): + mapping = ListField() + + Simple.drop_collection() + e = Simple() + e.mapping = 'hello world' + + self.assertRaises(ValidationError, e.save) + + def test_list_field_complex(self): """Ensure that the list fields can handle the complex types."""