Exemple #1
0
    def setUpTestData(cls):
        cls.admin = f.UserFactory()
        cls.admin_request = make_http_request(user=cls.admin,
                                              user_perm='issuetracker.add_issue')

        cls.case_run = f.TestCaseRunFactory()
        cls.bz_tracker = f.IssueTrackerFactory(name='MyBZ')
        testcaserun.attach_issue(cls.admin_request, {
            'case_run': [cls.case_run.pk],
            'issue_key': '67890',
            'tracker': cls.bz_tracker.pk,
            'summary': 'Testing TCMS',
            'description': 'Just foo and bar',
        })
Exemple #2
0
    def setUpTestData(cls):
        cls.admin = UserFactory(username='******', email='*****@*****.**')
        cls.admin_request = make_http_request(user=cls.admin,
                                              user_perm='issuetracker.add_issue')

        cls.case_run = TestCaseRunFactory()
        cls.bz_tracker = IssueTrackerFactory(name='MyBugzilla')
        testcaserun.attach_issue(cls.admin_request, {
            'case_run': [cls.case_run.pk],
            'issue_key': '67890',
            'tracker': cls.bz_tracker.pk,
            'summary': 'Testing TCMS',
            'description': 'Just foo and bar',
        })
Exemple #3
0
    def test_succeed_to_attach_issue_by_passing_extra_data(self):
        testcaserun.attach_issue(self.admin_request, {
            "case_run": [self.case_run.pk],
            "issue_key": '1200',
            "tracker": self.tracker.pk,
            "summary": "This is summary.",
            "description": "This is description.",
            "FFFF": "aaa"
        })

        self.assertTrue(Issue.objects.filter(
            issue_key='1200',
            case=self.case_run.case,
            case_run=self.case_run,
            tracker=self.tracker.pk
        ).exists())
Exemple #4
0
    def test_succeed_to_attach_issue_by_passing_extra_data(self):
        testcaserun.attach_issue(self.admin_request, {
            "case_run": [self.case_run.pk],
            "issue_key": '1200',
            "tracker": self.tracker.pk,
            "summary": "This is summary.",
            "description": "This is description.",
            "FFFF": "aaa"
        })

        self.assertTrue(Issue.objects.filter(
            issue_key='1200',
            case=self.case_run.case,
            case_run=self.case_run,
            tracker=self.tracker.pk
        ).exists())
Exemple #5
0
    def setUp(self):
        self.bz_bug = '67890'
        testcaserun.attach_issue(self.staff_request, {
            'case_run': [self.case_run.pk],
            'issue_key': self.bz_bug,
            'tracker': self.bz_tracker.pk,
            'summary': 'Testing TCMS',
            'description': 'Just foo and bar',
        })

        self.jira_key = 'AWSDF-112'
        testcaserun.attach_issue(self.staff_request, {
            'case_run': [self.case_run.pk],
            'issue_key': self.jira_key,
            'tracker': self.jira_tracker.pk,
            'summary': 'Testing TCMS',
            'description': 'Just foo and bar',
        })
Exemple #6
0
    def setUp(self):
        self.bz_bug = '67890'
        testcaserun.attach_issue(self.staff_request, {
            'case_run': [self.case_run.pk],
            'issue_key': self.bz_bug,
            'tracker': self.bz_tracker.pk,
            'summary': 'Testing TCMS',
            'description': 'Just foo and bar',
        })

        self.jira_key = 'AWSDF-112'
        testcaserun.attach_issue(self.staff_request, {
            'case_run': [self.case_run.pk],
            'issue_key': self.jira_key,
            'tracker': self.jira_tracker.pk,
            'summary': 'Testing TCMS',
            'description': 'Just foo and bar',
        })
Exemple #7
0
    def setUpTestData(cls):
        cls.admin = f.UserFactory(
            username='******', email='*****@*****.**')
        cls.admin_request = make_http_request(user=cls.admin,
                                              user_perm='issuetracker.add_issue')

        cls.case_run = f.TestCaseRunFactory()
        cls.bz_tracker = f.IssueTrackerFactory(name='MyBugzilla')
        f.ProductIssueTrackerRelationshipFactory(
            product=cls.case_run.run.plan.product,
            issue_tracker=cls.bz_tracker,
        )
        testcaserun.attach_issue(cls.admin_request, {
            'case_run': [cls.case_run.pk],
            'issue_key': '67890',
            'tracker': cls.bz_tracker.pk,
            'summary': 'Testing TCMS',
            'description': 'Just foo and bar',
        })
Exemple #8
0
    def test_attach_issue_with_required_args(self):
        bug = testcaserun.attach_issue(self.admin_request, {
            "case_run": [self.case_run.pk],
            "issue_key": '1',
            "tracker": self.tracker.pk,
        })
        self.assertIsNone(bug)

        self.assertTrue(Issue.objects.filter(
            issue_key='1',
            case=self.case_run.case,
            case_run=self.case_run,
            tracker=self.tracker.pk
        ).exists())
Exemple #9
0
    def test_attach_issue_with_required_args(self):
        bug = testcaserun.attach_issue(self.admin_request, {
            "case_run": [self.case_run.pk],
            "issue_key": '1',
            "tracker": self.tracker.pk,
        })
        self.assertIsNone(bug)

        self.assertTrue(Issue.objects.filter(
            issue_key='1',
            case=self.case_run.case,
            case_run=self.case_run,
            tracker=self.tracker.pk
        ).exists())
Exemple #10
0
    def test_attach_issue_with_all_fields(self):
        issue_summary = 'This is summary.'
        issue_description = 'This is description.'
        bug = testcaserun.attach_issue(self.admin_request, {
            "case_run": [self.case_run.pk],
            "issue_key": '2',
            "tracker": self.tracker.pk,
            "summary": issue_summary,
            "description": issue_description,
        })
        self.assertIsNone(bug)

        added_issue = Issue.objects.filter(
            issue_key='2',
            case=self.case_run.case,
            case_run=self.case_run,
            tracker=self.tracker.pk
        ).first()

        self.assertIsNotNone(added_issue)
        self.assertEqual(issue_summary, added_issue.summary)
        self.assertEqual(issue_description, added_issue.description)
Exemple #11
0
    def test_attach_issue_with_all_fields(self):
        issue_summary = 'This is summary.'
        issue_description = 'This is description.'
        bug = testcaserun.attach_issue(self.admin_request, {
            "case_run": [self.case_run.pk],
            "issue_key": '2',
            "tracker": self.tracker.pk,
            "summary": issue_summary,
            "description": issue_description,
        })
        self.assertIsNone(bug)

        added_issue = Issue.objects.filter(
            issue_key='2',
            case=self.case_run.case,
            case_run=self.case_run,
            tracker=self.tracker.pk
        ).first()

        self.assertIsNotNone(added_issue)
        self.assertEqual(issue_summary, added_issue.summary)
        self.assertEqual(issue_description, added_issue.description)
Exemple #12
0
    def test_attach_issue_with_chinese(self):
        issue_summary = u'你好,中国'
        issue_description = u'中国是一个具有悠久历史的文明古国'

        bug = testcaserun.attach_issue(self.admin_request, {
            "case_run": [self.case_run.pk],
            "issue_key": '12',
            "tracker": self.tracker.pk,
            "summary": issue_summary,
            "description": issue_description,
        })
        self.assertIsNone(bug)

        added_issue = Issue.objects.filter(
            issue_key='12',
            case=self.case_run.case,
            case_run=self.case_run,
            tracker=self.tracker.pk
        ).first()

        self.assertIsNotNone(added_issue)
        self.assertEqual(issue_summary, added_issue.summary)
        self.assertEqual(issue_description, added_issue.description)
Exemple #13
0
    def test_attach_issue_with_chinese(self):
        issue_summary = '你好,中国'
        issue_description = '中国是一个具有悠久历史的文明古国'

        bug = testcaserun.attach_issue(self.admin_request, {
            "case_run": [self.case_run.pk],
            "issue_key": '12',
            "tracker": self.tracker.pk,
            "summary": issue_summary,
            "description": issue_description,
        })
        self.assertIsNone(bug)

        added_issue = Issue.objects.filter(
            issue_key='12',
            case=self.case_run.case,
            case_run=self.case_run,
            tracker=self.tracker.pk
        ).first()

        self.assertIsNotNone(added_issue)
        self.assertEqual(issue_summary, added_issue.summary)
        self.assertEqual(issue_description, added_issue.description)