def test_process_new_launch_resize_prep_start(self): when = utils.str_time_to_unix('2012-12-21 12:34:50.123') json = test_utils.make_resize_prep_start_json() raw = create_raw(self.deployment, when, views.INSTANCE_EVENT['resize_prep_start'], json=json) views._process_usage_for_new_launch(raw) usages = InstanceUsage.objects.all() self.assertEqual(len(usages), 1) usage = usages[0] self.assertEqual(usage.instance, INSTANCE_ID_1) self.assertEqual(usage.request_id, REQUEST_ID_1) # The instance_type_id from resize prep notifications is the old one, # thus we ignore it. self.assertIsNone(usage.instance_type_id)