Exemple #1
0
 def test_information_type_saved(self):
     # Setting information_type to PROPRIETARY via form actually works.
     project = self.factory.makeProject()
     form = make_product_form(project.owner, action=2, proprietary=True)
     with person_logged_in(project.owner):
         view = create_initialized_view(project, '+newproduct', form=form)
     self.assertEqual(0, len(view.view.errors))
     product = getUtility(IProductSet).getByName(form['field.name'])
     self.assertEqual(InformationType.PROPRIETARY, product.information_type)
Exemple #2
0
 def test_information_type(self):
     # Information type controls are provided when creating a project via a
     # project group.
     form = make_product_form(action=1)
     project = self.factory.makeProject()
     with person_logged_in(project.owner):
         view = create_initialized_view(project, '+newproduct', form=form)
     self.assertIn('information_type_data',
                   IJSONRequestCache(view.request).objects)
     self.assertIsNot(None, view.view.form_fields.get('information_type'))