oioioi.testrun.tests

Module Contents

Classes

TestTestrunViews

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

TestWithNoTestruns

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

TestHandlers

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

TestRunTestCase

A TestCase mixin that provides some helpers for test run tests.

TestTestRunsLimit

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

class oioioi.testrun.tests.TestTestrunViews(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', 'test_testrun'][source]
test_status_visible()[source]
test_input_views()[source]
test_output_views()[source]
test_submit_view()[source]
test_archive_submission()[source]
test_code_pasting()[source]
test_submissions_permissions()[source]
class oioioi.testrun.tests.TestWithNoTestruns(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]
test_not_visible()[source]
class oioioi.testrun.tests.TestHandlers(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', 'test_testrun'][source]
test_handlers()[source]
class oioioi.testrun.tests.TestRunTestCase[source]

Bases: object

A TestCase mixin that provides some helpers for test run tests.

__test__ = False[source]
submit_test_run(user, contest, problem_instance, source_name='submission.cpp', source_contents=b'<test run source>', input_name='input.txt', input_contents=b'<test run input>')[source]
class oioioi.testrun.tests.TestTestRunsLimit(methodName='runTest')[source]

Bases: oioioi.base.tests.TestCase, TestRunTestCase, oioioi.programs.tests.SubmitFileMixin

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.

__test__ = True[source]
fixtures = ['test_users', 'test_contest', 'test_full_package', 'test_problem_instance'][source]
setUp()[source]

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

submit_solution(is_testrun)[source]
test_test_run_limit_should_be_respected()[source]
test_test_run_limit_should_be_independent_from_submission_limit()[source]
test_zero_test_run_limit_should_mean_unlimited_test_runs()[source]