'Tests that edited_on and edited_by are set correctly during an update'

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

    self.initdb(default_ms)
    test_course = self.store.create_course('testx', 'GreekHero', 'test_run', self.user_id)
    component = self.store.create_child(self.user_id, test_course.location, 'vertical')
    self.assertEqual(component.edited_by, self.user_id)
    old_edited_on = component.edited_on
    edit_user = (self.user_id - 2)
    component.display_name = 'Changed'
    self.store.update_item(component, edit_user)
    updated_component = self.store.get_item(component.location)
    self.assertLess(old_edited_on, updated_component.edited_on)
    self.assertEqual(updated_component.edited_by, edit_user)
