Exemplo n.º 1
0
 def test_update_by_ignoring_undoced_fields(self):
     case_run = testcaserun.update(self.admin_request, self.case_run_1.pk, {
         "notes": "AAAA",
         "close_date": datetime.now(),
         'anotherone': 'abc',
     })
     self.assertEqual('AAAA', case_run[0]['notes'])
Exemplo n.º 2
0
 def test_update_by_ignoring_undoced_fields(self):
     case_run = testcaserun.update(self.admin_request, self.case_run_1.pk, {
         "notes": "AAAA",
         "close_date": datetime.now(),
         'anotherone': 'abc',
     })
     self.assertEqual('AAAA', case_run[0]['notes'])
Exemplo n.º 3
0
 def test_update_with_single_caserun(self):
     tcr = testcaserun.update(self.admin_request, self.case_run_1.pk, {
         "build": self.build.pk,
         "assignee": self.user.pk,
         "case_run_status": self.status_running.pk,
         "notes": "AAAAAAAA",
         "sortkey": 90
     })
     self.assertIsNotNone(tcr)
     self.assertIsInstance(tcr, list)
     self.assertEqual(1, len(tcr))
     self.assertEqual(tcr[0]['build'], self.build.name)
     self.assertEqual(tcr[0]['assignee'], self.user.username)
     self.assertEqual(tcr[0]['case_run_status'], 'RUNNING')
     self.assertEqual(tcr[0]['notes'], "AAAAAAAA")
     self.assertEqual(tcr[0]['sortkey'], 90)
Exemplo n.º 4
0
 def test_update_with_single_caserun(self):
     tcr = testcaserun.update(self.admin_request, self.case_run_1.pk, {
         "build": self.build.pk,
         "assignee": self.user.pk,
         "case_run_status": self.status_running.pk,
         "notes": "AAAAAAAA",
         "sortkey": 90
     })
     self.assertIsNotNone(tcr)
     self.assertIsInstance(tcr, list)
     self.assertEqual(1, len(tcr))
     self.assertEqual(tcr[0]['build'], encode(self.build.name))
     self.assertEqual(tcr[0]['assignee'], self.user.username)
     self.assertEqual(tcr[0]['case_run_status'], encode('RUNNING'))
     self.assertEqual(tcr[0]['notes'], "AAAAAAAA")
     self.assertEqual(tcr[0]['sortkey'], 90)
Exemplo n.º 5
0
 def test_update_with_multi_caserun(self):
     tcr = testcaserun.update(
         self.admin_request, [self.case_run_1.pk, self.case_run_2.pk], {
             "build": self.build.pk,
             "assignee": self.user.pk,
             "case_run_status": self.status_running.pk,
             "notes": "Hello World!",
             "sortkey": 180
         })
     self.assertIsNotNone(tcr)
     self.assertIsInstance(tcr, list)
     self.assertEqual(len(tcr), 2)
     self.assertEqual(tcr[0]['build'], tcr[1]['build'])
     self.assertEqual(tcr[0]['assignee'], tcr[1]['assignee'])
     self.assertEqual(tcr[0]['case_run_status'], tcr[1]['case_run_status'])
     self.assertEqual(tcr[0]['notes'], tcr[1]['notes'])
     self.assertEqual(tcr[0]['sortkey'], tcr[1]['sortkey'])
Exemplo n.º 6
0
 def test_update_with_multi_caserun(self):
     tcr = testcaserun.update(self.admin_request,
                              [self.case_run_1.pk, self.case_run_2.pk],
                              {
                                  "build": self.build.pk,
                                  "assignee": self.user.pk,
                                  "case_run_status": self.status_running.pk,
                                  "notes": "Hello World!",
                                  "sortkey": 180
                              })
     self.assertIsNotNone(tcr)
     self.assertIsInstance(tcr, list)
     self.assertEqual(len(tcr), 2)
     self.assertEqual(tcr[0]['build'], tcr[1]['build'])
     self.assertEqual(tcr[0]['assignee'], tcr[1]['assignee'])
     self.assertEqual(tcr[0]['case_run_status'], tcr[1]['case_run_status'])
     self.assertEqual(tcr[0]['notes'], tcr[1]['notes'])
     self.assertEqual(tcr[0]['sortkey'], tcr[1]['sortkey'])