Exemple #1
0
    def setUpTestData(cls):
        super().setUpTestData()

        cls.empty_test_run = f.TestRunFactory(product_version=cls.version,
                                              plan=cls.plan,
                                              manager=cls.tester,
                                              default_tester=cls.tester)
        cls.test_run_no_issues = f.TestRunFactory(product_version=cls.version,
                                                  plan=cls.plan,
                                                  manager=cls.tester,
                                                  default_tester=cls.tester)

        cls.bz_tracker = cls.create_bz_tracker()

        cls.case_run_1.add_issue('12345', cls.bz_tracker)
        cls.case_run_1.add_issue('909090', cls.bz_tracker)
        cls.case_run_3.add_issue('4567890', cls.bz_tracker)
Exemple #2
0
    def setUpTestData(cls):
        super().setUpTestData()

        cls.case_run_status_idle = TestCaseRunStatus.objects.get(name='IDLE')
        cls.build = f.TestBuildFactory(product=cls.product)

        case_run_creator = partial(
            f.TestCaseRunFactory,
            assignee=cls.tester,
            tested_by=cls.tester,
            build=cls.build,
            case_run_status=cls.case_run_status_idle)

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

        cls.case_run_1 = case_run_creator(
            run=cls.test_run, case=cls.case_1, sortkey=10)

        cls.case_run_2 = case_run_creator(
            run=cls.test_run, case=cls.case_2, sortkey=20)

        cls.case_run_3 = case_run_creator(
            run=cls.test_run, case=cls.case_3, sortkey=30)

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

        cls.case_run_4 = case_run_creator(
            run=cls.test_run_1, case=cls.case_4, sortkey=10)

        cls.case_run_5 = case_run_creator(
            run=cls.test_run_1, case=cls.case_5, sortkey=20)

        cls.case_run_6 = case_run_creator(
            run=cls.test_run_1, case=cls.case_6, sortkey=30)
Exemple #3
0
    def setUpTestData(cls):
        super().setUpTestData()

        # Create an empty run for test
        cls.test_run_2 = f.TestRunFactory(product_version=cls.version,
                                          plan=cls.plan,
                                          build=cls.build,
                                          manager=cls.tester,
                                          default_tester=cls.tester)

        user_should_have_perm(cls.tester, 'testruns.change_testrun')
        cls.url = reverse('plan-choose-run', args=[cls.plan.pk])
Exemple #4
0
    def test_notify(self):
        run = f.TestRunFactory()

        out_mail = mail.outbox[0]

        self.assertEqual(run.get_notification_recipients(),
                         out_mail.recipients())
        self.assertEqual(
            f'A new test run is created from plan {run.plan.pk}: {run.summary}',
            out_mail.subject)
        self.assertIn(f'A new test run {run.pk} has been created for you.',
                      out_mail.body)
Exemple #5
0
 def setUpTestData(cls):
     super().setUpTestData()
     cls.build = f.TestBuildFactory(product=cls.product)
     cls.test_run = f.TestRunFactory(product_version=cls.version,
                                     plan=cls.plan,
                                     manager=cls.tester,
                                     default_tester=cls.tester)
     cls.case_run = f.TestCaseRunFactory(assignee=cls.tester,
                                         tested_by=cls.tester,
                                         case=cls.case,
                                         run=cls.test_run,
                                         build=cls.build)
     cls.bz_tracker = f.IssueTrackerFactory(name='TestBZ')
Exemple #6
0
    def setUpTestData(cls):
        cls.admin = f.UserFactory(
            username='******', email='*****@*****.**')
        cls.staff = f.UserFactory(
            username='******', email='*****@*****.**')
        cls.default_tester = f.UserFactory(
            username='******', email='*****@*****.**')
        cls.admin_request = make_http_request(user=cls.admin, user_perm='testruns.add_testcaserun')
        cls.staff_request = make_http_request(user=cls.staff)
        cls.product = f.ProductFactory(name='Nitrate')
        cls.version = f.VersionFactory(value='0.1', product=cls.product)
        cls.build = cls.product.build.all()[0]
        cls.plan = f.TestPlanFactory(
            author=cls.admin, owner=cls.admin, product=cls.product)
        cls.test_run = f.TestRunFactory(
            product_version=cls.version, build=cls.build,
            default_tester=None, plan=cls.plan)
        cls.case_run_status = TestCaseRunStatus.objects.get(name='IDLE')
        cls.case = f.TestCaseFactory(
            author=cls.admin, default_tester=None, plan=[cls.plan])

        cls.case_run_pks = []
Exemple #7
0
    def setUpTestData(cls):
        super().setUpTestData()

        cls.case_run_status_idle = TestCaseRunStatus.objects.get(name='IDLE')

        cls.build = f.TestBuildFactory(product=cls.product)

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

        cls.case_run_1, cls.case_run_2, cls.case_run_3 = [
            f.TestCaseRunFactory(assignee=cls.tester,
                                 tested_by=cls.tester,
                                 run=cls.test_run,
                                 build=cls.build,
                                 case_run_status=cls.case_run_status_idle,
                                 case=case,
                                 sortkey=i * 10)
            for i, case in enumerate((cls.case_1, cls.case_2, cls.case_3), 1)
        ]
Exemple #8
0
    def setUpTestData(cls):
        super().setUpTestData()

        get_status = f.TestCaseRunStatus.objects.get
        cls.case_run_status_idle = get_status(name='IDLE')
        cls.case_run_status_failed = get_status(name='FAILED')
        cls.case_run_status_waived = get_status(name='WAIVED')

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

        for case, status in ((cls.case_1, cls.case_run_status_idle),
                             (cls.case_2, cls.case_run_status_failed),
                             (cls.case_3, cls.case_run_status_failed),
                             (cls.case_4, cls.case_run_status_waived),
                             (cls.case_5, cls.case_run_status_waived),
                             (cls.case_6, cls.case_run_status_waived)):
            f.TestCaseRunFactory(assignee=cls.tester,
                                 tested_by=cls.tester,
                                 run=cls.test_run,
                                 case=case,
                                 case_run_status=status)
Exemple #9
0
    def setUpTestData(cls):
        super().setUpTestData()

        cls.cool_product = f.ProductFactory(name='CoolProduct')
        cls.cool_version = f.VersionFactory(value='0.1',
                                            product=cls.cool_product)

        cls.env_group_db = f.TCMSEnvGroupFactory(name='db')

        cls.plan_02 = f.TestPlanFactory(
            author=cls.tester,
            owner=cls.tester,
            product=cls.product,
            product_version=cls.version,
            env_group=[cls.env_group_db],
        )

        cls.case_001 = f.TestCaseFactory(author=cls.tester,
                                         default_tester=None,
                                         reviewer=cls.tester,
                                         case_status=cls.case_status_confirmed,
                                         plan=[cls.plan_02])
        cls.case_002 = f.TestCaseFactory(author=cls.tester,
                                         default_tester=None,
                                         reviewer=cls.tester,
                                         case_status=cls.case_status_confirmed,
                                         plan=[cls.plan_02])

        cls.plan_03 = f.TestPlanFactory(author=cls.tester,
                                        owner=cls.tester,
                                        product=cls.cool_product,
                                        product_version=cls.cool_version)
        cls.case_003 = f.TestCaseFactory(author=cls.tester,
                                         default_tester=None,
                                         reviewer=cls.tester,
                                         case_status=cls.case_status_confirmed,
                                         plan=[cls.plan_03])
        cls.case_004 = f.TestCaseFactory(author=cls.tester,
                                         default_tester=None,
                                         reviewer=cls.tester,
                                         case_status=cls.case_status_confirmed,
                                         plan=[cls.plan_03])

        # Data for testing combination search
        # Create cases with priority P2 and associate them to cls.test_run
        priority_p2 = Priority.objects.get(value='P2')
        priority_p3 = Priority.objects.get(value='P3')

        cls.case_p2_01 = f.TestCaseFactory(
            author=cls.tester,
            default_tester=None,
            reviewer=cls.tester,
            case_status=cls.case_status_confirmed,
            plan=[cls.plan_03],
            priority=priority_p2)
        f.TestCaseRunFactory(assignee=cls.tester,
                             tested_by=cls.tester,
                             run=cls.test_run,
                             build=cls.build,
                             case_run_status=cls.case_run_status_idle,
                             case=cls.case_p2_01,
                             sortkey=1000)

        # A new case to cls.plan, whose priority is P3.
        cls.case_005 = f.TestCaseFactory(author=cls.tester,
                                         default_tester=None,
                                         reviewer=cls.tester,
                                         case_status=cls.case_status_confirmed,
                                         plan=[cls.plan],
                                         priority=priority_p3)

        # Test run for asserting env_group column
        cls.test_run_with_env_group = f.TestRunFactory(
            product_version=cls.version,
            plan=cls.plan_02,
            build=cls.build,
            manager=cls.tester,
            default_tester=cls.tester)

        cls.url = reverse('advance_search')
Exemple #10
0
                                        manager=cls.tester,
                                        default_tester=cls.tester)

        cls.case_run_1, cls.case_run_2, cls.case_run_3 = [
            f.TestCaseRunFactory(assignee=cls.tester,
                                 tested_by=cls.tester,
                                 run=cls.test_run,
                                 build=cls.build,
                                 case_run_status=cls.case_run_status_idle,
                                 case=case,
                                 sortkey=i * 10)
            for i, case in enumerate((cls.case_1, cls.case_2, cls.case_3), 1)
        ]

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

        cls.case_run_4, cls.case_run_5, cls.case_run_6 = [
            f.TestCaseRunFactory(assignee=cls.tester,
                                 tested_by=cls.tester,
                                 run=cls.test_run_1,
                                 build=cls.build,
                                 case_run_status=cls.case_run_status_idle,
                                 case=case,
                                 sortkey=i * 10)
            for i, case in enumerate((cls.case_4, cls.case_5, cls.case_6), 1)
        ]
Exemple #11
0
    def setUpTestData(cls):
        super().setUpTestData()

        cls.empty_test_run = f.TestRunFactory(manager=cls.tester,
                                              default_tester=cls.tester,
                                              plan=cls.plan)
Exemple #12
0
 def setUpTestData(cls):
     cls.test_run = f.TestRunFactory()