'Ensure that the entire DictField can be atomically updated.'

def test_atomic_update_dict_field(self):

    class Simple(Document, ):
        mapping = DictField(field=ListField(IntField(required=True)))
    Simple.drop_collection()
    e = Simple()
    e.mapping['someints'] = [1, 2]
    e.save()
    e.update(set__mapping={'ints': [3, 4]})
    e.reload()
    self.assertEqual(BaseDict, type(e.mapping))
    self.assertEqual({'ints': [3, 4]}, e.mapping)
    with self.assertRaises(ValueError):
        e.update(set__mapping={'somestrings': ['foo', 'bar']})
