oioioi.quizzes.tests

Module Contents

Classes

SubmitQuizMixin

TestTextInput

Similar to TransactionTestCase, but use transaction.atomic() to achieve

TestSubmission

Similar to TransactionTestCase, but use transaction.atomic() to achieve

TestScore

Similar to TransactionTestCase, but use transaction.atomic() to achieve

TestScoreRejudgeAfterNewQuestionsAdded

Similar to TransactionTestCase, but use transaction.atomic() to achieve

TestSubmissionView

Similar to TransactionTestCase, but use transaction.atomic() to achieve

TestEditQuizQuestions

Similar to TransactionTestCase, but use transaction.atomic() to achieve

TestQuizBleach

Similar to TransactionTestCase, but use transaction.atomic() to achieve

TestPictures

Similar to TransactionTestCase, but use transaction.atomic() to achieve

TestQuizProblemView

Similar to TransactionTestCase, but use transaction.atomic() to achieve

class oioioi.quizzes.tests.SubmitQuizMixin[source]

Bases: oioioi.contests.tests.SubmitMixin

submit_quiz(contest, problem_instance, answers)[source]

Submits a quiz with given answer :param contest: in what contest to submit :param problem_instance: indicates which quiz to submit :param answers: dictionary mapping question ids to:

  1. answer id

  2. list of answer ids if question is multiple choice

:return response to the request

class oioioi.quizzes.tests.TestTextInput(methodName='runTest')[source]

Bases: oioioi.base.tests.TestCase, SubmitQuizMixin

Similar to TransactionTestCase, but use transaction.atomic() to achieve test isolation.

In most situations, TestCase should be preferred to TransactionTestCase as it allows faster execution. However, there are some situations where using TransactionTestCase might be necessary (e.g. testing some transactional behavior).

On database backends with no transaction support, TestCase behaves as TransactionTestCase.

fixtures = ['test_users', 'test_basic_contest', 'test_problem_instance', 'test_quiz_problem_with_text_input'][source]
setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_simple_submission()[source]
test_second_possible_answer()[source]
test_wrong_answer()[source]
class oioioi.quizzes.tests.TestSubmission(methodName='runTest')[source]

Bases: oioioi.base.tests.TestCase, SubmitQuizMixin

Similar to TransactionTestCase, but use transaction.atomic() to achieve test isolation.

In most situations, TestCase should be preferred to TransactionTestCase as it allows faster execution. However, there are some situations where using TransactionTestCase might be necessary (e.g. testing some transactional behavior).

On database backends with no transaction support, TestCase behaves as TransactionTestCase.

fixtures = ['test_users', 'test_basic_contest', 'test_quiz_problem', 'test_quiz_problem_second',...[source]
setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_simple_submission()[source]
test_empty_multiple_choice()[source]
test_wrong_id()[source]
test_submission_unanswered_question()[source]
class oioioi.quizzes.tests.TestScore(methodName='runTest')[source]

Bases: oioioi.base.tests.TestCase

Similar to TransactionTestCase, but use transaction.atomic() to achieve test isolation.

In most situations, TestCase should be preferred to TransactionTestCase as it allows faster execution. However, there are some situations where using TransactionTestCase might be necessary (e.g. testing some transactional behavior).

On database backends with no transaction support, TestCase behaves as TransactionTestCase.

fixtures = ['test_users', 'test_contest', 'test_quiz_problem', 'test_quiz_problem_second',...[source]
test_multiple_choice_no_correct_answer_score()[source]
test_all_answers_correct_score()[source]
test_one_answer_incorrect_score()[source]
class oioioi.quizzes.tests.TestScoreRejudgeAfterNewQuestionsAdded(methodName='runTest')[source]

Bases: TestScore

Similar to TransactionTestCase, but use transaction.atomic() to achieve test isolation.

In most situations, TestCase should be preferred to TransactionTestCase as it allows faster execution. However, there are some situations where using TransactionTestCase might be necessary (e.g. testing some transactional behavior).

On database backends with no transaction support, TestCase behaves as TransactionTestCase.

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_closed_added_question_no_given_answer_score()[source]
test_open_added_question_no_given_answer_score()[source]
class oioioi.quizzes.tests.TestSubmissionView(methodName='runTest')[source]

Bases: oioioi.base.tests.TestCase

Similar to TransactionTestCase, but use transaction.atomic() to achieve test isolation.

In most situations, TestCase should be preferred to TransactionTestCase as it allows faster execution. However, there are some situations where using TransactionTestCase might be necessary (e.g. testing some transactional behavior).

On database backends with no transaction support, TestCase behaves as TransactionTestCase.

fixtures = ['test_users', 'test_contest', 'test_quiz_problem', 'test_problem_instance', 'test_quiz_submission'][source]
setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_question_report()[source]
test_submission_score_visible()[source]
test_diff_submission_unavailable()[source]
class oioioi.quizzes.tests.TestEditQuizQuestions(methodName='runTest')[source]

Bases: oioioi.base.tests.TestCase

Similar to TransactionTestCase, but use transaction.atomic() to achieve test isolation.

In most situations, TestCase should be preferred to TransactionTestCase as it allows faster execution. However, there are some situations where using TransactionTestCase might be necessary (e.g. testing some transactional behavior).

On database backends with no transaction support, TestCase behaves as TransactionTestCase.

fixtures = ['test_users', 'test_contest', 'test_quiz_problem'][source]
setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_edit_quiz_questions()[source]
class oioioi.quizzes.tests.TestQuizBleach(methodName='runTest')[source]

Bases: oioioi.base.tests.TestCase

Similar to TransactionTestCase, but use transaction.atomic() to achieve test isolation.

In most situations, TestCase should be preferred to TransactionTestCase as it allows faster execution. However, there are some situations where using TransactionTestCase might be necessary (e.g. testing some transactional behavior).

On database backends with no transaction support, TestCase behaves as TransactionTestCase.

fixtures = ['test_users', 'test_basic_contest', 'test_quiz_bleach', 'test_problem_instance'][source]
setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_quizbleach()[source]
class oioioi.quizzes.tests.TestPictures(methodName='runTest')[source]

Bases: oioioi.base.tests.TestCase

Similar to TransactionTestCase, but use transaction.atomic() to achieve test isolation.

In most situations, TestCase should be preferred to TransactionTestCase as it allows faster execution. However, there are some situations where using TransactionTestCase might be necessary (e.g. testing some transactional behavior).

On database backends with no transaction support, TestCase behaves as TransactionTestCase.

fixtures = ['test_users', 'test_basic_contest', 'test_quiz_problem_pictures', 'test_problem_instance'][source]
setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_embedding()[source]
test_invalid_mode()[source]
test_access()[source]
test_download()[source]
class oioioi.quizzes.tests.TestQuizProblemView(methodName='runTest')[source]

Bases: oioioi.base.tests.TestCase

Similar to TransactionTestCase, but use transaction.atomic() to achieve test isolation.

In most situations, TestCase should be preferred to TransactionTestCase as it allows faster execution. However, there are some situations where using TransactionTestCase might be necessary (e.g. testing some transactional behavior).

On database backends with no transaction support, TestCase behaves as TransactionTestCase.

fixtures = ['test_users', 'test_contest', 'test_full_package', 'test_problem_instance',...[source]
disabled_quiz_tabs = ['Problem statement'][source]
allowed_quiz_tabs = ['Secret key', 'Settings'][source]
test_quiz_tab_visibility()[source]
test_normal_problem_tab_visibility()[source]