'Update locations updates location and keeps values and "is_set_on" status'

def test_update_locations_native_xblock(self):

    self.xblock.location = Location('org', 'import', 'run', 'category', 'stubxblock')
    self.xblock.test_content_field = 'Explicitly    set'
    self.xblock.test_settings_field = 'Explicitly    set'
    self.xblock.test_mutable_content_field = [1, 2, 3]
    self.xblock.test_mutable_settings_field = ['a', 's', 'd']
    self.xblock.children = self.fake_children_locations
    self.xblock.save()
    target_location = self.xblock.location.replace(revision='draft')
    _update_module_location(self.xblock, target_location)
    new_version = self.xblock
    self.assertEqual(new_version.location, target_location)
    self.assertEqual(new_version.test_content_field, 'Explicitly    set')
    self.assertEqual(new_version.test_settings_field, 'Explicitly    set')
    self.assertEqual(new_version.test_mutable_content_field, [1, 2, 3])
    self.assertEqual(new_version.test_mutable_settings_field, ['a', 's', 'd'])
    self.assertEqual(new_version.children, self.fake_children_locations)
    self._check_explicitly_set(new_version, Scope.content, self.CONTENT_FIELDS, should_be_set=True)
    self._check_explicitly_set(new_version, Scope.settings, self.SETTINGS_FIELDS, should_be_set=True)
    self._check_explicitly_set(new_version, Scope.children, self.CHILDREN_FIELDS, should_be_set=True)
    for field in ((self.CONTENT_FIELDS + self.SETTINGS_FIELDS) + self.CHILDREN_FIELDS):
        self.assertTrue(new_version.fields[field].is_set_on(new_version))
