def test_review_request_closed_email_hook_discarded(self):
        class DummyHook(ReviewRequestClosedEmailHook):
            def get_to_field(self, to_field, review_request, user, close_type):
                return set([user])

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

        hook = DummyHook(self.extension)

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

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

        call_kwargs = {
            'user': admin,
            'review_request': review_request,
            'close_type': ReviewRequest.DISCARDED,
        }

        with set_siteconfig_settings({'mail_send_review_close_mail': True}):
            review_request.close(ReviewRequest.DISCARDED, admin)

        self.assertEqual(len(mail.outbox), 1)
        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)
Add posix attributes for the user/group
dataset/ETHPy150Open reviewboard/reviewboard/reviewboard/extensions/tests.py/EmailHookTests.test_review_request_closed_email_hook_discarded--crossover with--dataset/ETHPy150Open byt3bl33d3r/pth-toolkit/lib/python2.7/site-packages/samba/upgrade.py/add_posix_attrs