'Ensure the right requester is specified when initiating refunds.'

@mock.patch(u'commerce.signals.refund_seat')
@mock.patch(u'commerce.signals.get_request_user', return_value=None)
def test_requester(self, mock_get_request_user, mock_refund_seat):

    self.send_signal()
    self.assertTrue(mock_refund_seat.called)
    self.assertEqual(mock_refund_seat.call_args[0], (self.course_enrollment,))
    mock_get_request_user.return_value = self.student
    mock_refund_seat.reset_mock()
    self.send_signal()
    self.assertTrue(mock_refund_seat.called)
    self.assertEqual(mock_refund_seat.call_args[0], (self.course_enrollment,))
    mock_get_request_user.return_value = self.requester
    mock_refund_seat.reset_mock()
    self.send_signal()
    self.assertTrue(mock_refund_seat.called)
    self.assertEqual(mock_refund_seat.call_args[0], (self.course_enrollment,))
    mock_get_request_user.return_value = AnonymousUser()
    mock_refund_seat.reset_mock()
    self.send_signal()
    self.assertFalse(mock_refund_seat.called)
