Пример #1
0
 def test_make_order_number_aware(self):
     context = mock.Mock()
     self.assertEqual(False, IOrderNumberAware.providedBy(context))
     request = mock.Mock()
     view = Miscellaneous(context, request)
     view.make_order_number_aware()
     self.assertEqual(True, IOrderNumberAware.providedBy(context))
 def test_make_order_number_aware(self):
     context = mock.Mock()
     self.assertEqual(False, IOrderNumberAware.providedBy(context))
     request = mock.Mock()
     view = Miscellaneous(context, request)
     view.make_order_number_aware()
     self.assertEqual(True, IOrderNumberAware.providedBy(context))
 def test_is_order_number_aware(self):
     context = mock.Mock()
     self.assertEqual(False, IOrderNumberAware.providedBy(context))
     request = mock.Mock()
     view = Miscellaneous(context, request)
     self.assertEqual(False, view.is_order_number_aware())
     alsoProvides(context, IOrderNumberAware)
     self.assertEqual(False, view.is_order_number_aware())
     alsoProvides(context, IPloneFormGenForm)
     self.assertEqual(True, view.is_order_number_aware())
     noLongerProvides(context, IOrderNumberAware)
     self.assertEqual(False, view.is_order_number_aware())
Пример #4
0
 def test_is_order_number_aware(self):
     context = mock.Mock()
     self.assertEqual(False, IOrderNumberAware.providedBy(context))
     request = mock.Mock()
     view = Miscellaneous(context, request)
     self.assertEqual(False, view.is_order_number_aware())
     alsoProvides(context, IOrderNumberAware)
     self.assertEqual(False, view.is_order_number_aware())
     alsoProvides(context, IPloneFormGenForm)
     self.assertEqual(True, view.is_order_number_aware())
     noLongerProvides(context, IOrderNumberAware)
     self.assertEqual(False, view.is_order_number_aware())