'Tests that we can set a uuid but not save it and it\'s removed when
backporting to an older version of the object.'

@mock.patch.object(db, 'security_group_update')
def test_with_uuid(self, mock_db_update):

    secgroup = security_group.SecurityGroup(self.context, uuid=uuids.neutron_id)
    self.assertEqual(uuids.neutron_id, secgroup.uuid)
    primitive = secgroup.obj_to_primitive(target_version='1.1')
    self.assertNotIn('uuid', primitive)
    self.assertIn('uuid', secgroup)
    secgroup.save()
    self.assertFalse(mock_db_update.called)
