code: def test_translation_direct(self, pair):
      tokenizer, model, src_text, tgt_text = self.translation_setup(
          pair
      )
  
      input_ids = tokenizer.encode(src_text, return_tensors="pt").to(
          torch_device
      )
  
      outputs = model.generate(input_ids)
      decoded = tokenizer.decode(outputs[0], skip_special_tokens=True)
      assert (
          decoded == tgt_text
      ), f"\n\ngot: {decoded}\nexp: {tgt_text}\n"
  
imports: import tempfile
  import unittest
  import timeout_decorator
  from parameterized import parameterized
  from transformers import FSMTConfig, is_torch_available
  from transformers.testing_utils import require_sentencepiece, require_tokenizers, require_torch, slow, torch_device
  from transformers.utils import cached_property
  from ...generation.test_generation_utils import GenerationTesterMixin
  from ...test_configuration_common import ConfigTester
  from ...test_modeling_common import ModelTesterMixin, ids_tensor
label_desc: Use image node_id 7 for calling the FSMTModelIntegrationTests obj's underlying member method code with example usage: obj.test_translation_direct(pair) without return types