Example #1
0
    def test_notification(self):
        request = self.stub()
        poodle = self.create_dummy(
            REQUEST=request,
            Title='Test Poll',
            Creator=lambda: 'hugo.boss')

        notifier = self.stub()
        self.mock_utility(
            notifier, INotifier, name='email-notifier')
        self.expect(
            notifier.send_notification(to_list=['hugo.boss'], object_=poodle))

        self.replay()

        view = JQSubmitData(poodle, request)
        view.poodle = poodle

        view._send_notification()