def test_reduce_setter(self): """ Test that the reduce setter works """ ddoc = DesignDocument(self.db, 'ddoc001') view = View(ddoc, 'view001') self.assertIsNone(view.get('reduce')) view.reduce = '_count' self.assertEqual(view.get('reduce'), '_count')
def test_map_setter(self): """ Test that the map setter works """ ddoc = DesignDocument(self.db, 'ddoc001') view = View(ddoc, 'view001') self.assertIsNone(view.get('map')) view.map = 'function (doc) {\n emit(doc._id, 1);\n}' self.assertEqual(view.get('map'), 'function (doc) {\n emit(doc._id, 1);\n}')
def test_map_setter(self): """ Test that the map setter works """ ddoc = DesignDocument(self.db, 'ddoc001') view = View(ddoc, 'view001') self.assertIsNone(view.get('map')) view.map = 'function (doc) {\n emit(doc._id, 1);\n}' self.assertEqual( view.get('map'), 'function (doc) {\n emit(doc._id, 1);\n}' )