def test_interactive_handler_enqueues_task_and_redirects(self, uuid): uuid.uuid4.return_value = 'UUID' handler = ImportHandler(None, Mock()) handler.request_string = Mock(return_value='1') handler.redirect = Mock() handler.post() self.assertTasksInQueue(n=1, queue_names=UNISUBS_FETCH_Q) handler.request_string.assert_called_once_with('interactive') handler.redirect.assert_called_once_with('/admin/unisubs?_started=UUID')
def test_interactive_handler_enqueues_task_and_redirects(self, uuid): uuid.uuid4.return_value = 'UUID' handler = ImportHandler(None, Mock()) handler.request_string = Mock(return_value='1') handler.redirect = Mock() handler.post() self.assertTasksInQueue(n=1, queue_names=UNISUBS_FETCH_Q) handler.request_string.assert_called_once_with('interactive') handler.redirect.assert_called_once_with( '/admin/unisubs?_started=UUID')