def METHOD_NAME(self, cmd_output, expected_delete_count, expected_kept_events):
    self.assertNotIn('Dry run requested', cmd_output)
    if expected_delete_count == 0:
        delete_text = 'No events older than'
    else:
        delete_text = 'Deleting {} event'.format(expected_delete_count)
    self.assertIn(delete_text, cmd_output)
    self.assertCountEqual(
        PersonApiKeyEvent.objects.all(),
        expected_kept_events,
        'Wrong events were deleted'
    )