'Tests that has_changes() returns true for the parent when a child with changes is added
and false when that child is removed.'

@ddt.data(ModuleStoreEnum.Type.mongo, ModuleStoreEnum.Type.split)
def test_has_changes_add_remove_child(self, default_ms):

    locations = self.setup_has_changes(default_ms)
    self.assertFalse(self._has_changes(locations['grandparent']))
    self.assertFalse(self._has_changes(locations['parent']))
    self.store.create_child(self.user_id, locations['parent'], 'vertical', block_id='new_child')
    self.assertTrue(self._has_changes(locations['grandparent']))
    self.assertTrue(self._has_changes(locations['parent']))
    parent = self.store.get_item(locations['parent'])
    parent.children = [locations['child'], locations['child_sibling']]
    self.store.update_item(parent, user_id=self.user_id)
    self.assertFalse(self._has_changes(locations['grandparent']))
    self.assertFalse(self._has_changes(locations['parent']))
