예제 #1
0
def check_problem_instance_state(env, suspend_init_tests=None, **kwargs):
    if _is_suspended(env['problem_instance_id'], suspend_init_tests) and not \
            _is_hidden_rejudge(env) and not _is_admin_submission(env) and not \
            _is_model_solution(env):
        mark_submission_state(env, 'SUSPENDED', **kwargs)
        raise Ignore

    return env
예제 #2
0
파일: tests.py 프로젝트: marmistrz/oioioi
    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')