def test_review_request_published_email_hook(self):
        class DummyHook(ReviewRequestPublishedEmailHook):
            def get_to_field(self, to_field, review_request, user):
                return set([user])

            def get_cc_field(self, cc_field, review_request, user):
                return set([user])

        hook = DummyHook(self.extension)

        self.spy_on(hook.get_to_field)
        self.spy_on(hook.get_cc_field)

        review_request = self.create_review_request()
        admin = User.objects.get(username='admin')

        call_kwargs = {
            'user': admin,
            'review_request': review_request,
        }

        with set_siteconfig_settings({'mail_send_review_mail': True}):
            review_request.publish(admin)

        self.assertEqual(len(mail.outbox), 1)
        self.assertEqual(mail.outbox[0].to,
                         [get_email_address_for_user(admin)])
        self.assertTrue(hook.get_to_field.spy.called)
        self.assertEqual(hook.get_to_field.spy.calls[0].kwargs, call_kwargs)
        self.assertTrue(hook.get_cc_field.spy.called)
        self.assertEqual(hook.get_cc_field.spy.calls[0].kwargs, call_kwargs)
Switch to a specific panel header.
dataset/ETHPy150Open reviewboard/reviewboard/reviewboard/extensions/tests.py/EmailHookTests.test_review_request_published_email_hook--crossover with--dataset/ETHPy150Open kivy/kivy/kivy/uix/tabbedpanel.py/TabbedPanel.switch_to