:orphan: :py:mod:`oioioi.testrun.tests` ============================== .. py:module:: oioioi.testrun.tests Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: oioioi.testrun.tests.TestTestrunViews oioioi.testrun.tests.TestWithNoTestruns oioioi.testrun.tests.TestHandlers oioioi.testrun.tests.TestRunTestCase oioioi.testrun.tests.TestTestRunsLimit .. py:class:: TestTestrunViews(methodName='runTest') Bases: :py:obj:`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. .. py:attribute:: fixtures :annotation: = ['test_users', 'test_contest', 'test_full_package', 'test_problem_instance', 'test_testrun'] .. py:method:: test_status_visible() .. py:method:: test_input_views() .. py:method:: test_output_views() .. py:method:: test_submit_view() .. py:method:: test_archive_submission() .. py:method:: test_code_pasting() .. py:method:: test_submissions_permissions() .. py:class:: TestWithNoTestruns(methodName='runTest') Bases: :py:obj:`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. .. py:attribute:: fixtures :annotation: = ['test_users', 'test_contest', 'test_full_package', 'test_problem_instance'] .. py:method:: test_not_visible() .. py:class:: TestHandlers(methodName='runTest') Bases: :py:obj:`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. .. py:attribute:: fixtures :annotation: = ['test_users', 'test_contest', 'test_full_package', 'test_problem_instance', 'test_testrun'] .. py:method:: test_handlers() .. py:class:: TestRunTestCase Bases: :py:obj:`object` A TestCase mixin that provides some helpers for test run tests. .. py:attribute:: __test__ :annotation: = False .. py:method:: submit_test_run(user, contest, problem_instance, source_name='submission.cpp', source_contents=b'', input_name='input.txt', input_contents=b'') .. py:class:: TestTestRunsLimit(methodName='runTest') Bases: :py:obj:`oioioi.base.tests.TestCase`, :py:obj:`TestRunTestCase`, :py:obj:`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. .. py:attribute:: __test__ :annotation: = True .. py:attribute:: fixtures :annotation: = ['test_users', 'test_contest', 'test_full_package', 'test_problem_instance'] .. py:method:: setUp() Hook method for setting up the test fixture before exercising it. .. py:method:: submit_solution(is_testrun) .. py:method:: test_test_run_limit_should_be_respected() .. py:method:: test_test_run_limit_should_be_independent_from_submission_limit() .. py:method:: test_zero_test_run_limit_should_mean_unlimited_test_runs()