Example #1
0
    def test_revoke(self):
        """Test if a submit revokes properly."""
        job_id = 'dummy'
        env = {}
        env['job_id'] = job_id
        env['submission_id'] = 1

        submission = Submission.objects.get(pk=1)
        qs = QueuedSubmit(submission=submission, state='CANCELLED',
                          celery_task_id=job_id)
        qs.save()

        with self.assertRaises(Ignore):
            mark_submission_state(env, state='PROGRESS')
Example #2
0
    def test_admin_view(self):
        """Test if a submit shows on the list properly."""
        submission = Submission.objects.get(pk=1)
        qs = QueuedSubmit(submission=submission, state='QUEUED',
                          celery_task_id='dummy')
        qs.save()
        self.assertStateCountEqual('Queued', 1)

        qs.state = 'PROGRESS'
        qs.save()

        self.assertStateCountEqual('In progress', 1)

        qs.state = 'CANCELLED'
        qs.save()

        self.assertNotPresent(['In progress', 'Queued'])