:py:mod:`oioioi.problems.tests.test_problem` ============================================ .. py:module:: oioioi.problems.tests.test_problem Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: oioioi.problems.tests.test_problem.TestProblemViews oioioi.problems.tests.test_problem.TestProblemPackageAdminView oioioi.problems.tests.test_problem.TestProblemPackageViews oioioi.problems.tests.test_problem.TestProblemSite oioioi.problems.tests.test_problem.TestProblemChangeForm oioioi.problems.tests.test_problem.TestSubmissionLeft oioioi.problems.tests.test_problem.TestSubmissionLeftWhenNoLimit oioioi.problems.tests.test_problem.TestSubmissionLeftWhenNoContest oioioi.problems.tests.test_problem.TestProblemSearchPermissions oioioi.problems.tests.test_problem.TestProblemSearch Functions ~~~~~~~~~ .. autoapisummary:: oioioi.problems.tests.test_problem.get_submission_left .. py:class:: TestProblemViews(methodName='runTest') Bases: :py:obj:`oioioi.base.tests.TestCase`, :py:obj:`oioioi.filetracker.tests.TestStreamingMixin` 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_permissions'] .. py:method:: post_package_file(url, filename, visibility=Problem.VISIBILITY_PRIVATE) .. py:method:: test_problem_statement_view() .. py:method:: test_admin_changelist_view() .. py:method:: test_admin_change_view() .. py:method:: test_admin_delete_view_basic() .. py:method:: test_admin_add_in_contest_delete_in_problemset() .. py:method:: test_admin_add_to_contest_delete_in_problemset() .. py:method:: _test_problem_permissions() .. py:method:: test_problem_permissions() .. py:class:: TestProblemPackageAdminView(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_problem_packages', 'test_problem_instance',... .. py:method:: test_links() .. py:method:: test_problem_info_brace() .. py:class:: TestProblemPackageViews(methodName='runTest') Bases: :py:obj:`oioioi.base.tests.TestCase`, :py:obj:`oioioi.filetracker.tests.TestStreamingMixin` 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_problem_packages', 'test_problem_instance'] .. py:method:: _test_package_permissions(is_admin=False) .. py:method:: test_admin_changelist_view() .. py:method:: test_package_file_view() .. py:method:: test_package_traceback_view() .. py:method:: test_package_permissions() .. py:class:: TestProblemSite(methodName='runTest') Bases: :py:obj:`oioioi.base.tests.TestCase`, :py:obj:`oioioi.filetracker.tests.TestStreamingMixin` 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_with_no_contest',... .. py:method:: setUp() Hook method for setting up the test fixture before exercising it. .. py:method:: _get_site_urls() .. py:method:: _create_PA() .. py:method:: test_default_tabs() .. py:method:: test_statement_tab() .. py:method:: test_submissions_tab() .. py:method:: test_submit_tab() .. py:method:: test_settings_tab() .. py:method:: test_statement_replacement() .. py:method:: test_add_new_tab() .. py:method:: test_external_statement_view() .. py:method:: test_external_attachment_view() .. py:method:: test_form_accessibility() .. py:class:: TestProblemChangeForm(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_quiz_problem_second'] .. py:method:: test_programming_problem_change_form() .. py:method:: test_quiz_problem_change_form() .. py:function:: get_submission_left(username, contest_id='c', pi_pk=1) .. py:class:: TestSubmissionLeft(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_submission'] .. py:method:: test_admin() .. py:method:: test_user_without_submissions() .. py:method:: test_user_with_submissions() .. py:method:: test_not_authenticated_user() .. py:class:: TestSubmissionLeftWhenNoLimit(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',... .. py:method:: test_admin() .. py:method:: test_user_without_submissions() .. py:method:: test_user_with_submissions() .. py:method:: test_not_authenticated_user() .. py:class:: TestSubmissionLeftWhenNoContest(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_full_package', 'test_problem_instance_with_no_contest'] .. py:method:: test_admin() .. py:method:: test_user_without_submissions() .. py:method:: test_not_authenticated_user() .. py:class:: TestProblemSearchPermissions(methodName='runTest') Bases: :py:obj:`oioioi.base.tests.TestCase`, :py:obj:`oioioi.problems.tests.utilities.AssertContainsOnlyMixin` 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_problem_search_permissions'] .. py:attribute:: url .. py:method:: test_search_permissions_public() .. py:method:: test_search_permissions_my() .. py:method:: test_search_permissions_all() .. py:class:: TestProblemSearch(methodName='runTest') Bases: :py:obj:`oioioi.base.tests.TestCase`, :py:obj:`oioioi.problems.tests.utilities.AssertContainsOnlyMixin` 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_problem_search'] .. py:attribute:: url .. py:method:: test_search_name() .. py:method:: test_search_name_unicode() .. py:method:: test_search_name_multiple() .. py:method:: _test_search_name_localized(queries, exp_names) .. py:method:: test_search_name_localized_en() .. py:method:: test_search_name_localized_pl() .. py:method:: test_search_short_name() .. py:method:: test_search_short_name_multiple() .. py:method:: test_search_tags_basic()