Beispiel #1
0
 def test_add_component_with_non_exist(self):
     try:
         product.add_component(self.admin_request, 99999, "MyComponent")
     except Fault as f:
         self.assertEqual(f.faultCode, 404, AssertMessage.SHOULD_BE_404)
     else:
         self.fail(AssertMessage.NOT_VALIDATE_PERMS)
Beispiel #2
0
 def test_add_component_with_no_perms(self):
     try:
         product.add_component(self.staff_request, 1, "MyComponent")
     except Fault as f:
         self.assertEqual(f.faultCode, 403, AssertMessage.SHOULD_BE_403)
     else:
         self.fail(AssertMessage.NOT_VALIDATE_PERMS)
Beispiel #3
0
 def test_given_initial_qa_contact_does_not_exist(self):
     component = product.add_component(
         self.admin_request,
         self.product.pk,
         "dist",
         initial_qa_contact_id=get_max_user_id() + 1)
     self.assertEqual(self.admin.pk, component['initial_qa_contact_id'])
Beispiel #4
0
 def test_specify_initial_owner(self):
     component = product.add_component(
         self.admin_request,
         self.product.pk,
         "db",
         initial_owner_id=self.initial_owner.pk)
     self.assertEqual(self.initial_owner.pk, component['initial_owner_id'])
Beispiel #5
0
 def test_add_component(self):
     com = product.add_component(self.admin_request, self.product.pk,
                                 "application")
     self.components_to_delete.append(com['id'])
     self.assertIsNotNone(com)
     self.assertEqual(com['name'], 'application')
     self.assertEqual(com['initial_owner'], self.admin.username)
Beispiel #6
0
 def test_specify_initial_qa_contact(self):
     component = product.add_component(
         self.admin_request,
         self.product.pk, "web",
         initial_qa_contact_id=self.initial_qa_contact.pk)
     self.assertEqual(self.initial_qa_contact.pk,
                      component['initial_qa_contact_id'])
Beispiel #7
0
 def test_add_component(self):
     try:
         com = product.add_component(self.admin_request, 1, "MyComponent")
     except Fault:
         self.fail(AssertMessage.UNEXCEPT_ERROR)
     else:
         self.assertIsNotNone(com)
         self.assertEqual(com['name'], 'MyComponent')
         self.assertEqual(com['initial_owner'], 'tcr_admin')
Beispiel #8
0
 def test_add_component(self):
     com = product.add_component(self.admin_request, self.product.pk, "application")
     self.components_to_delete.append(com['id'])
     self.assertIsNotNone(com)
     self.assertEqual(com['name'], 'application')
     self.assertEqual(com['initial_owner'], self.admin.username)