def METHOD_NAME(self):
    # Base case
    result = ExternalIssue.objects.get_for_integration(integration=self.api_integration1)
    assert len(result) == 2
    for ei in [self.external_issue1, self.external_issue2]:
        assert ei in result
    # Empty case
    result = ExternalIssue.objects.get_for_integration(integration=self.api_integration3)
    assert len(result) == 0
    # Key provided case
    result = ExternalIssue.objects.get_for_integration(
        integration=self.api_integration1, external_issue_key=self.external_issue2.key
    )
    assert len(result) == 1
    assert self.external_issue2 in result