Пример #1
0
class TestExecutionRemoveLink(XmlrpcAPIBaseTest):
    def _fixture_setup(self):
        super()._fixture_setup()

        self.status_idle = TestExecutionStatus.objects.get(name='IDLE')
        self.tester = UserFactory()
        self.case_run = TestExecutionFactory(assignee=self.tester,
                                             tested_by=None,
                                             sortkey=10,
                                             status=self.status_idle)

    def setUp(self):
        super().setUp()

        self.rpc_client.exec.TestExecution.add_link(
            self.case_run.pk, 'Related issue', 'https://localhost/issue/1')
        self.link = self.case_run.links()[0]

    def test_doesnt_raise_with_non_existing_id(self):
        self.rpc_client.exec.TestExecution.remove_link(-9, self.link.pk)
        links = self.case_run.links()
        self.assertEqual(1, links.count())
        self.assertEqual(self.link.pk, links[0].pk)

    def test_detach_log_with_non_exist_log(self):
        self.rpc_client.exec.TestExecution.remove_link(self.case_run.pk,
                                                       999999999)
        links = self.case_run.links()
        self.assertEqual(1, links.count())
        self.assertEqual(self.link.pk, links[0].pk)

    def test_detach_log(self):
        self.rpc_client.exec.TestExecution.remove_link(self.case_run.pk,
                                                       self.link.pk)
        self.assertEqual([], list(self.case_run.links()))
Пример #2
0
class TestExecutionAddLinkPermissions(APIPermissionsTestCase):
    """Test permissions of TestExecution.add_link"""

    permission_label = 'linkreference.add_linkreference'

    def _fixture_setup(self):
        super()._fixture_setup()

        self.execution = TestExecutionFactory()

    def verify_api_with_permission(self):
        links = self.execution.links()
        self.assertFalse(links.exists())

        url = 'http://example.com'
        result = self.rpc_client.TestExecution.add_link({
            'execution_id': self.execution.pk,
            'url': url})

        links = self.execution.links()
        self.assertEqual(self.execution.pk, result['execution'])
        self.assertEqual(url, result['url'])
        self.assertEqual(1, links.count())
        self.assertEqual(url, links.first().url)

    def verify_api_without_permission(self):
        url = 'http://127.0.0.1/test/test-log.log'
        with self.assertRaisesRegex(ProtocolError, '403 Forbidden'):
            self.rpc_client.TestExecution.add_link({
                'execution_id': self.execution.pk,
                'name': 'UT test logs',
                'url': url})
Пример #3
0
    def test_update_with_single_test_execution(self):
        execution = TestExecutionFactory(tested_by=None)

        result = self.rpc_client.TestExecution.update(
            execution.pk,
            {
                "build": self.build.pk,
                "assignee": self.user.pk,
                "sortkey": 90,
                "start_date": "2021-02-25",
                "stop_date": "2021-02-28 12:12:12",
            },
        )

        execution.refresh_from_db()

        self.assertEqual(result["id"], execution.pk)
        self.assertEqual(result["assignee"], self.user.pk)
        self.assertEqual(result["tested_by"], None)
        self.assertIn("case_text_version", result)
        self.assertEqual(result["start_date"], execution.start_date)
        self.assertEqual(result["stop_date"], execution.stop_date)
        self.assertEqual(result["sortkey"], 90)
        self.assertIn("run", result)
        self.assertIn("case", result)
        self.assertEqual(result["build"], self.build.pk)
        self.assertIn("status", result)
Пример #4
0
class TestExecutionRemoveLinkPermissions(APIPermissionsTestCase):
    """Test permissions of TestExecution.remove_link"""

    permission_label = 'linkreference.delete_linkreference'

    def _fixture_setup(self):
        super()._fixture_setup()

        self.execution = TestExecutionFactory()
        self.link = LinkReferenceFactory(execution=self.execution)
        self.another_link = LinkReferenceFactory(execution=self.execution)

    def verify_api_with_permission(self):
        links = self.execution.links()
        self.assertEqual(2, links.count())
        self.assertIn(self.link, links)
        self.assertIn(self.another_link, links)

        self.rpc_client.TestExecution.remove_link({'pk': self.link.pk})

        links = self.execution.links()
        self.assertEqual(1, links.count())
        self.assertIn(self.another_link, links)
        self.assertNotIn(self.link, links)

    def verify_api_without_permission(self):
        with self.assertRaisesRegex(ProtocolError, '403 Forbidden'):
            self.rpc_client.TestExecution.remove_link(
                {'pk': self.another_link.pk})
Пример #5
0
    def _fixture_setup(self):
        super()._fixture_setup()

        self.execution_1 = TestExecutionFactory()
        self.execution_1.case.summary = "Tested at " + timezone.now(
        ).isoformat()
        self.execution_1.case.text = "Given-When-Then"
        self.execution_1.case.save()  # will generate history object
        self.execution_1.run.summary = (
            "Automated TR for GitHub integration on " +
            timezone.now().isoformat())
        self.execution_1.run.save()

        self.component = ComponentFactory(
            name="GitHub integration",
            product=self.execution_1.run.plan.product)
        self.execution_1.case.add_component(self.component)

        bug_system = BugSystem.objects.create(  # nosec:B106:hardcoded_password_funcarg
            name="GitHub for kiwitcms/test-github-integration",
            tracker_type="tcms.issuetracker.types.GitHub",
            base_url="https://github.com/kiwitcms/test-github-integration",
            api_password=os.getenv("GH_BUGTRACKER_INTEGRATION_TEST_API_TOKEN"),
        )
        self.integration = GitHub(bug_system, None)
Пример #6
0
class TestExecutionAddLinkPermissions(APIPermissionsTestCase):
    """Test permissions of TestExecution.add_link"""

    permission_label = "linkreference.add_linkreference"

    def _fixture_setup(self):
        super()._fixture_setup()

        self.execution = TestExecutionFactory()

    def verify_api_with_permission(self):
        links = self.execution.links()
        self.assertFalse(links.exists())

        url = "http://example.com"
        result = self.rpc_client.TestExecution.add_link(
            {"execution_id": self.execution.pk, "url": url}
        )

        links = self.execution.links()
        self.assertEqual(self.execution.pk, result["execution"])
        self.assertEqual(url, result["url"])
        self.assertEqual(1, links.count())
        self.assertEqual(url, links.first().url)

    def verify_api_without_permission(self):
        url = "http://127.0.0.1/test/test-log.log"
        with self.assertRaisesRegex(ProtocolError, "403 Forbidden"):
            self.rpc_client.TestExecution.add_link(
                {"execution_id": self.execution.pk, "name": "UT test logs", "url": url}
            )
Пример #7
0
    def _fixture_setup(self):
        super()._fixture_setup()

        self.execution_1 = TestExecutionFactory()
        self.execution_1.case.summary = "Tested at " + timezone.now().isoformat()
        self.execution_1.case.text = "Given-When-Then"
        self.execution_1.case.save()  # will generate history object
        self.execution_1.run.summary = (
            "Automated TR for BitBucket integration on " + timezone.now().isoformat()
        )
        self.execution_1.run.save()

        self.component = ComponentFactory(
            name="BitBucket integration", product=self.execution_1.run.plan.product
        )
        self.execution_1.case.add_component(self.component)

        bug_system = BugSystem.objects.create(  # nosec:B106:hardcoded_password_funcarg
            name="BitBucket for kiwitcms/test-bitbucket-integration",
            tracker_type="tcms.issuetracker.bitbucket.BitBucket",
            base_url="https://bitbucket.org/kiwitcms/integration",
            api_username=os.getenv("BITBUCKET_INTEGRATION_API_USERNAME"),
            api_password=os.getenv("BITBUCKET_INTEGRATION_API_PASSWORD"),
        )
        self.integration = BitBucket(bug_system, None)
Пример #8
0
    def _fixture_setup(self):
        super()._fixture_setup()

        self.execution_1 = TestExecutionFactory()
        self.execution_1.case.summary = "Tested at " + timezone.now(
        ).isoformat()
        self.execution_1.case.text = "Given-When-Then"
        self.execution_1.case.save()  # will generate history object
        self.execution_1.run.summary = (
            "Automated TR for Azure integration on " +
            timezone.now().isoformat())
        self.execution_1.run.save()

        self.component = ComponentFactory(
            name="AzureBoards integration",
            product=self.execution_1.run.plan.product)
        self.execution_1.case.add_component(self.component)

        bug_system = BugSystem.objects.create(  # nosec:B106:hardcoded_password_funcarg
            name="Azure for kiwitcms/test-azure-integration",
            tracker_type="tcms.issuetracker.azure_boards.AzureBoards",
            base_url="https://dev.azure.com/kiwitcms/boards-integration",
            api_password=os.getenv("AZURE_BOARDS_INTEGRATION_API_TOKEN"),
        )
        self.integration = AzureBoards(bug_system, None)
Пример #9
0
    def _fixture_setup(self):
        super()._fixture_setup()

        self.execution_1 = TestExecutionFactory()
        self.execution_1.case.summary = "Tested at " + timezone.now(
        ).isoformat()
        self.execution_1.case.text = "Given-When-Then"
        self.execution_1.case.save()  # will generate history object
        self.execution_1.run.summary = (
            "Automated TR for JIRA integration on " +
            timezone.now().isoformat())
        self.execution_1.run.save()

        # this is the name of the JIRA Project
        self.execution_1.run.plan.product.name = "Integration with JIRA"
        self.execution_1.run.plan.product.save()

        self.component = ComponentFactory(
            name="JIRA integration", product=self.execution_1.run.plan.product)
        self.execution_1.case.add_component(self.component)

        bug_system = BugSystem.objects.create(  # nosec:B106:hardcoded_password_funcarg
            name="JIRA at kiwitcms.atlassian.net",
            tracker_type="tcms.issuetracker.types.JIRA",
            base_url="https://kiwitcms.atlassian.net",
            api_username=os.getenv("JIRA_BUGTRACKER_INTEGRATION_API_USERNAME"),
            api_password=os.getenv("JIRA_BUGTRACKER_INTEGRATION_API_TOKEN"),
        )
        self.integration = JIRA(bug_system, None)
Пример #10
0
    def _fixture_setup(self):
        super()._fixture_setup()

        self.user = UserFactory()
        self.execution_1 = TestExecutionFactory()
        self.status_positive = TestExecutionStatus.objects.filter(
            weight__gt=0).last()
Пример #11
0
    def _fixture_setup(self):
        super()._fixture_setup()

        self.status_idle = TestExecutionStatus.objects.get(name='IDLE')
        self.tester = UserFactory()
        self.case_run = TestExecutionFactory(assignee=self.tester, tested_by=None,
                                             sortkey=10,
                                             status=self.status_idle)
Пример #12
0
    def _fixture_setup(self):
        super()._fixture_setup()

        self.status_idle = TestExecutionStatus.objects.filter(weight=0).first()
        self.tester = UserFactory()
        self.execution = TestExecutionFactory(
            assignee=self.tester, tested_by=None, sortkey=10, status=self.status_idle
        )
Пример #13
0
    def setUpTestData(cls):
        cls.test_run = TestRunFactory()
        cls.execution_1 = TestExecutionFactory(run=cls.test_run)
        cls.execution_2 = TestExecutionFactory(run=cls.test_run)

        cls.url = reverse("testruns-clone", args=[cls.test_run.pk])

        super().setUpTestData()
Пример #14
0
    def _fixture_setup(self):
        super()._fixture_setup()

        self.user = UserFactory()
        self.build = BuildFactory()
        self.case_run_1 = TestExecutionFactory()
        self.case_run_2 = TestExecutionFactory()
        self.status_running = TestExecutionStatus.objects.get(name='RUNNING')
Пример #15
0
    def test_changes_tested_by(self):
        execution = TestExecutionFactory(tested_by=None)

        self.rpc_client.TestExecution.update(
            execution.pk, {"status": self.status_positive.pk})
        execution.refresh_from_db()

        self.assertEqual(execution.tested_by, self.api_user)
        self.assertEqual(execution.status, self.status_positive)
Пример #16
0
    def _fixture_setup(self):
        super()._fixture_setup()

        self.case_run_1 = TestExecutionFactory()
        self.case_run_2 = TestExecutionFactory()

        self.rpc_client.exec.TestExecution.add_link(self.case_run_1.pk,
                                                    "Test logs",
                                                    "http://www.google.com")
Пример #17
0
    def setUpTestData(cls):
        super().setUpTestData()

        cls.status_idle = TestExecutionStatus.objects.filter(weight=0).first()

        cls.build = BuildFactory(version=cls.version)

        cls.test_run = TestRunFactory(
            product_version=cls.version,
            plan=cls.plan,
            build=cls.build,
            manager=cls.tester,
            default_tester=cls.tester,
        )

        executions = []
        for i, case in enumerate((cls.case_1, cls.case_2, cls.case_3), 1):
            executions.append(
                TestExecutionFactory(
                    assignee=cls.tester,
                    run=cls.test_run,
                    build=cls.build,
                    status=cls.status_idle,
                    case=case,
                    sortkey=i * 10,
                ))

        # used in other tests as well
        cls.execution_1 = executions[0]
        cls.execution_2 = executions[1]
        cls.execution_3 = executions[2]

        cls.test_run_1 = TestRunFactory(
            product_version=cls.version,
            plan=cls.plan,
            build=cls.build,
            manager=cls.tester,
            default_tester=cls.tester,
        )

        # create a few more TestExecution objects
        for i, case in enumerate((cls.case_4, cls.case_5, cls.case_6), 1):
            executions.append(
                TestExecutionFactory(
                    assignee=cls.tester,
                    tested_by=cls.tester,
                    run=cls.test_run_1,
                    build=cls.build,
                    status=cls.status_idle,
                    case=case,
                    sortkey=i * 10,
                ))
        # used in other tests as well
        cls.execution_4 = executions[3]
        cls.execution_5 = executions[4]
        cls.execution_6 = executions[5]
Пример #18
0
    def _fixture_setup(self):
        super()._fixture_setup()

        self.case_run_1 = TestExecutionFactory()
        self.case_run_2 = TestExecutionFactory()

        self.rpc_client.exec.TestExecution.add_link({
            'execution_id': self.case_run_1.pk,
            'name': 'Test logs',
            'url': 'http://kiwitcms.org'})
Пример #19
0
    def test_when_tested_by_specified_does_not_change_tested_by(self):
        execution = TestExecutionFactory(tested_by=None)

        self.rpc_client.TestExecution.update(execution.pk, {
            'status': self.status_positive.pk,
            'tested_by': self.user.pk,
        })
        execution.refresh_from_db()

        self.assertEqual(execution.tested_by, self.user)
        self.assertEqual(execution.status, self.status_positive)
Пример #20
0
    def _fixture_setup(self):
        super()._fixture_setup()

        self.execution_1 = TestExecutionFactory()
        self.execution_2 = TestExecutionFactory()

        self.rpc_client.TestExecution.add_link(
            {
                "execution_id": self.execution_1.pk,
                "name": "Test logs",
                "url": "http://kiwitcms.org",
            }
        )
Пример #21
0
    def setUpTestData(cls):
        super(BaseCaseRun, cls).setUpTestData()

        # todo: we need a linter to find all places where we get statuses
        # by hard-coded names instead of class based attribute constants!
        cls.status_idle = TestExecutionStatus.objects.get(name='IDLE')

        cls.build = BuildFactory(product=cls.product)

        cls.test_run = TestRunFactory(product_version=cls.version,
                                      plan=cls.plan,
                                      build=cls.build,
                                      manager=cls.tester,
                                      default_tester=cls.tester)

        executions = []
        for i, case in enumerate((cls.case_1, cls.case_2, cls.case_3), 1):
            executions.append(
                TestExecutionFactory(assignee=cls.tester,
                                     run=cls.test_run,
                                     build=cls.build,
                                     status=cls.status_idle,
                                     case=case,
                                     sortkey=i * 10))

        # used in other tests as well
        cls.execution_1 = executions[0]
        cls.execution_2 = executions[1]
        cls.execution_3 = executions[2]

        cls.test_run_1 = TestRunFactory(product_version=cls.version,
                                        plan=cls.plan,
                                        build=cls.build,
                                        manager=cls.tester,
                                        default_tester=cls.tester)

        # create a few more TestExecution objects
        for i, case in enumerate((cls.case_4, cls.case_5, cls.case_6), 1):
            executions.append(
                TestExecutionFactory(assignee=cls.tester,
                                     tested_by=cls.tester,
                                     run=cls.test_run_1,
                                     build=cls.build,
                                     status=cls.status_idle,
                                     case=case,
                                     sortkey=i * 10))
        # used in other tests as well
        cls.execution_4 = executions[3]
        cls.execution_5 = executions[4]
        cls.execution_6 = executions[5]
Пример #22
0
    def test_update_status_changes_run_neutral(self):
        """
        When updating the status of a TestExecution to a not completed one (status.weigth == 0),
        set the run as not completed
        """
        run = TestRunFactory(stop_date=timezone.now())

        execution = TestExecutionFactory(status=self.status_positive, run=run)
        _ = TestExecutionFactory(status=self.status_negative, run=run)

        self.rpc_client.TestExecution.update(
            execution.pk, {"status": self.status_in_progress.pk})

        run.refresh_from_db()
        self.assertIsNone(run.stop_date)
Пример #23
0
    def test_report_issue_from_test_execution_falls_back_to_query_params(self):
        """
            In case 1-click bug-report fails Bugzilla integration will open
            a URL with some of the fields pre-defined so the tester will have
            an easier time filling in the rest.
        """
        # note: automatically creates a version called 'unspecified'
        product = ProductFactory(name='Kiwi TCMS')
        version, _ = Version.objects.get_or_create(product=product, value='unspecified')
        component = ComponentFactory(name='Bugzilla integration', product=product)

        test_plan = TestPlanFactory(product=product, product_version=version)
        test_case = TestCaseFactory(component=[component], plan=[test_plan])
        test_case.save()  # will generate history object

        test_run = TestRunFactory(plan=test_plan, product_version=version)
        execution2 = TestExecutionFactory(run=test_run, case=test_case, build=test_run.build)

        # simulate user clicking the 'Report bug' button in TE widget, TR page
        result = self.rpc_client.Bug.report(execution2.pk, self.integration.bug_system.pk)
        self.assertEqual(result['rc'], 0)
        self.assertIn('http://bugtracker.kiwitcms.org/bugzilla/enter_bug.cgi', result['response'])

        # assert that the result looks like valid URL parameters
        self.assertIn('product=Kiwi+TCMS', result['response'])
        self.assertIn('component=Bugzilla+integration', result['response'])
        self.assertIn('version=unspecified', result['response'])
        expected_description = urlencode({
            'short_desc': "Test case failure: %s" % execution2.case.summary,
        })
        self.assertIn(expected_description, result['response'])
Пример #24
0
    def setUpTestData(cls):
        super(TestGetCaseRunsStatsByStatus, cls).setUpTestData()

        cls.statuss = TestExecutionStatus.objects.all().order_by('pk')

        cls.status_idle = TestExecutionStatus.objects.get(name='IDLE')
        cls.status_failed = TestExecutionStatus.objects.get(name='FAILED')
        cls.status_waived = TestExecutionStatus.objects.get(name='WAIVED')

        cls.test_run = TestRunFactory(product_version=cls.version,
                                      plan=cls.plan,
                                      manager=cls.tester,
                                      default_tester=cls.tester)

        for case, status in ((cls.case_1, cls.status_idle),
                             (cls.case_2, cls.status_failed),
                             (cls.case_3, cls.status_failed),
                             (cls.case_4, cls.status_waived),
                             (cls.case_5, cls.status_waived),
                             (cls.case_6, cls.status_waived)):
            TestExecutionFactory(assignee=cls.tester,
                                 tested_by=cls.tester,
                                 run=cls.test_run,
                                 case=case,
                                 status=status)
Пример #25
0
 def setUpTestData(cls):
     super(TestCaseRemoveBug, cls).setUpTestData()
     cls.build = BuildFactory(product=cls.product)
     cls.test_run = TestRunFactory(product_version=cls.version, plan=cls.plan,
                                   manager=cls.tester, default_tester=cls.tester)
     cls.case_run = TestExecutionFactory(assignee=cls.tester, tested_by=cls.tester,
                                         case=cls.case, run=cls.test_run, build=cls.build)
     cls.bug_system = BugSystem.objects.get(name='Bugzilla')
Пример #26
0
    def test_update_status_changes_run_status_completed(self):
        """
        When updating the status of a TestExecution to a completed one (status.weigth != 0),
        if all executions for a run are completed, set the run as completed
        """
        run = TestRunFactory(stop_date=None)

        TestExecutionFactory(status=self.status_positive, run=run)
        TestExecutionFactory(status=self.status_negative, run=run)
        execution = TestExecutionFactory(status=self.status_in_progress,
                                         run=run)

        self.rpc_client.TestExecution.update(
            execution.pk, {"status": self.status_positive.pk})

        run.refresh_from_db()
        self.assertIsNotNone(run.stop_date)
Пример #27
0
    def _fixture_setup(self):
        super()._fixture_setup()

        self.execution = TestExecutionFactory()
        self.comments = ["Text for first comment", "Text for second comment"]

        for comment in self.comments:
            comments.add_comment([self.execution], comment, self.tester)
Пример #28
0
class TestExecutionRemoveLink(APITestCase):
    def _fixture_setup(self):
        super()._fixture_setup()

        self.status_idle = TestExecutionStatus.objects.filter(weight=0).first()
        self.tester = UserFactory()
        self.execution = TestExecutionFactory(assignee=self.tester,
                                              tested_by=None,
                                              sortkey=10,
                                              status=self.status_idle)

    def setUp(self):
        super().setUp()

        self.rpc_client.TestExecution.add_link({
            'execution_id':
            self.execution.pk,
            'name':
            'Related issue',
            'url':
            'https://localhost/issue/1'
        })
        self.link = self.execution.links()[0]

    def test_doesnt_raise_with_non_existing_id(self):
        self.rpc_client.TestExecution.remove_link({'execution_id': -9})
        links = self.execution.links()
        self.assertEqual(1, links.count())
        self.assertEqual(self.link.pk, links[0].pk)

    def test_detach_log_with_non_exist_log(self):
        self.rpc_client.TestExecution.remove_link({'pk': 999999999})
        links = self.execution.links()
        self.assertEqual(1, links.count())
        self.assertEqual(self.link.pk, links[0].pk)

    def test_detach_log(self):
        self.rpc_client.TestExecution.remove_link({
            'execution_id':
            self.execution.pk,
            'pk':
            self.link.pk
        })
        self.assertEqual([], list(self.execution.links()))
Пример #29
0
    def _fixture_setup(self):
        super()._fixture_setup()

        self.execution_1 = TestExecutionFactory()
        self.execution_1.case.text = "Given-When-Then"
        self.execution_1.case.save()  # will generate history object

        self.component = ComponentFactory(
            name='Gitlab integration',
            product=self.execution_1.run.plan.product)
        self.execution_1.case.add_component(self.component)

        bug_system = BugSystem.objects.create(  # nosec:B106:hardcoded_password_funcarg
            name='GitLab-EE for root/kiwitcms',
            tracker_type='Gitlab',
            base_url='http://bugtracker.kiwitcms.org/root/kiwitcms/',
            api_url='http://bugtracker.kiwitcms.org',
            api_password='******',
        )
        self.integration = Gitlab(bug_system)
Пример #30
0
    def test_report_issue_from_test_execution_1click_works(self):
        """
        Automatic 1-click bug report to Bugzilla usually works
        when Product, Version and Component exist in Bugzilla!
        """
        # note: automatically creates a version called 'unspecified'
        product = ProductFactory(name="TestProduct")
        version, _ = Version.objects.get_or_create(product=product,
                                                   value="unspecified")
        component = ComponentFactory(name="TestComponent", product=product)

        test_plan = TestPlanFactory(product=product, product_version=version)
        test_case = TestCaseFactory(component=[component], plan=[test_plan])
        test_case.save()  # will generate history object

        test_run = TestRunFactory(plan=test_plan, product_version=version)
        execution2 = TestExecutionFactory(run=test_run,
                                          case=test_case,
                                          build=test_run.build)

        # simulate user clicking the 'Report bug' button in TE widget, TR page
        result = self.rpc_client.Bug.report(execution2.pk,
                                            self.integration.bug_system.pk)
        self.assertEqual(result["rc"], 0)
        self.assertIn(
            "http://bugtracker.kiwitcms.org/bugzilla/show_bug.cgi?id=",
            result["response"],
        )

        new_bug_id = self.integration.bug_id_from_url(result["response"])
        bug = self.integration.rpc.getbug(new_bug_id)

        self.assertEqual("TestProduct", bug.product)
        self.assertEqual("TestComponent", bug.component)
        self.assertEqual("unspecified", bug.version)
        self.assertEqual("All", bug.op_sys)
        self.assertEqual("All", bug.rep_platform)

        last_comment = bug.getcomments()[-1]
        for expected_string in [
                "Filed from execution %s" % execution2.get_full_url(),
                product.name,
                component.name,
                test_case.text,
        ]:
            self.assertIn(expected_string, last_comment["text"])

        # verify that LR has been added to TE
        self.assertTrue(
            LinkReference.objects.filter(
                execution=execution2,
                url=result["response"],
                is_defect=True,
            ).exists())