Beispiel #1
0
    def test_put(self):
        """Create a new status and then edit it"""
        yield self.create_test_status()
        statuses = yield submission_statuses.retrieve_all_submission_statuses(
            1, u'en')

        for status in statuses:
            if status['label'] == 'test_status':
                status_uuid = status['id']

        # Change the submission status info
        data_request = {'label': '12345', 'presentation_order': 0}

        self._handler = submission_statuses.SubmissionStatusInstance
        handler = self.request(data_request, role='admin')
        yield handler.put(status_uuid)
        statuses = yield submission_statuses.retrieve_all_submission_statuses(
            1, u'en')

        found_label = False

        for status in statuses:
            if status['label'] == '12345':
                found_label = True
                break

        self.assertEqual(found_label, True)
    def test_put(self):
        """Create a new status and then edit it"""
        yield self.create_test_status()
        statuses = yield submission_statuses.retrieve_all_submission_statuses(1, u'en')

        for status in statuses:
            if status['label'] == 'test_status':
                status_uuid = status['id']

        # Change the submission status info
        data_request = {
            'label': '12345',
            'presentation_order': 0
        }

        self._handler = submission_statuses.SubmissionStatusInstance
        handler = self.request(data_request, role='admin')
        yield handler.put(status_uuid)
        statuses = yield submission_statuses.retrieve_all_submission_statuses(1, u'en')

        found_label = False

        for status in statuses:
            if status['label'] == '12345':
                found_label = True
                break

        self.assertEqual(found_label, True)
    def test_delete(self):
        """Delete a status (if possible)"""
        yield self.create_test_status()
        statuses = yield submission_statuses.retrieve_all_submission_statuses(1, u'en')

        for status in statuses:
            if status['label'] == 'test_status':
                status_uuid = status['id']

        self._handler = submission_statuses.SubmissionStatusInstance
        handler = self.request(role='admin')
        yield handler.delete(status_uuid)

        session_status_count = yield count_submission_statuses(1)
        self.assertEqual(session_status_count, 3)
Beispiel #4
0
    def test_delete(self):
        """Delete a status (if possible)"""
        yield self.create_test_status()
        statuses = yield submission_statuses.retrieve_all_submission_statuses(1, u'en')

        for status in statuses:
            if status['label'] == 'test_status':
                status_uuid = status['id']

        self._handler = submission_statuses.SubmissionStatusInstance
        handler = self.request(role='admin')
        yield handler.delete(status_uuid)

        session_status_count = yield count_submission_statuses(1)
        self.assertEqual(session_status_count, 3)