:orphan: :py:mod:`oioioi.base.tests.tests` ================================= .. py:module:: oioioi.base.tests.tests Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: oioioi.base.tests.tests.TestPermsTemplateTags oioioi.base.tests.tests.TestIndex oioioi.base.tests.tests.TestIndexNoContest oioioi.base.tests.tests.TestMainPage oioioi.base.tests.tests.TestOrderedRegistry oioioi.base.tests.tests.TestMenu oioioi.base.tests.tests.TestErrorHandlers oioioi.base.tests.tests.TestUtils oioioi.base.tests.tests.TestAllWithPrefix oioioi.base.tests.tests.TestDottedFieldClass oioioi.base.tests.tests.TestDottedFieldSubclass oioioi.base.tests.tests.TestFields oioioi.base.tests.tests.TestEnumField oioioi.base.tests.tests.TestExecute oioioi.base.tests.tests.TestMisc oioioi.base.tests.tests.TestRegistration oioioi.base.tests.tests.TestArchive oioioi.base.tests.tests.TestAdmin oioioi.base.tests.tests.TestBaseViews oioioi.base.tests.tests.TestBackendMiddleware oioioi.base.tests.tests.TestNotifications oioioi.base.tests.tests.TestCondition oioioi.base.tests.tests.TestLoginChange oioioi.base.tests.tests.TestPreferences oioioi.base.tests.tests.TestTranslate oioioi.base.tests.tests.TestFileUtils oioioi.base.tests.tests.TestUserDeactivationLogout oioioi.base.tests.tests.TestObtainingAPIToken oioioi.base.tests.tests.TestDocsEndpoints oioioi.base.tests.tests.TestPingEndpointsAndAuthentication oioioi.base.tests.tests.TestPasswordReset oioioi.base.tests.tests.TestAccountDeletion oioioi.base.tests.tests.TestJsCatalog Attributes ~~~~~~~~~~ .. autoapisummary:: oioioi.base.tests.tests.basedir .. py:data:: basedir .. py:class:: TestPermsTemplateTags(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'] .. py:method:: test_check_perms() .. py:class:: TestIndex(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'] .. py:method:: test_login() .. py:method:: test_admin_login_redirect() .. py:method:: test_logout() .. py:method:: test_index() .. py:method:: test_accounts_menu() .. py:class:: TestIndexNoContest(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'] .. py:method:: test_no_contest() .. py:method:: test_navbar_login() .. py:class:: TestMainPage(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'] .. py:attribute:: custom_templates .. py:method:: test_custom_main_page() .. py:class:: TestOrderedRegistry(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:method:: test_ordered_registry() .. py:class:: TestMenu(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_icon'] .. py:method:: setUp() Hook method for setting up the test fixture before exercising it. .. py:method:: tearDown() Hook method for deconstructing the test fixture after testing it. .. py:method:: _render_menu(user=None) .. py:method:: test_menu() .. py:method:: test_is_contest_admin() .. py:method:: test_menu_item_attrs_escape() .. py:method:: test_side_menus_registry() .. py:class:: TestErrorHandlers(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'] .. py:method:: setUp() Modify the client so that it follows to handler500 view on error, retaining cookies. .. py:method:: ajax_get(url) .. py:method:: assertHtml(response, code) .. py:method:: assertPlain(response, code) .. py:method:: test_ajax_errors() .. py:method:: test_errors() .. py:method:: test_user_in_500() .. py:class:: TestUtils(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:method:: test_classinit() .. py:method:: test_registered_subclasses_meta() .. py:method:: test_object_with_mixins() .. py:method:: test_mixins_mro() .. py:method:: test_registered_with_mixing() .. py:method:: test_memoized() .. py:method:: test_reset_memoized() .. py:method:: test_utils_dont_need_settings() .. py:class:: TestAllWithPrefix(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:method:: test_all_with_prefix() .. py:class:: TestDottedFieldClass Bases: :py:obj:`oioioi.base.utils.RegisteredSubclassesBase` A base class for classes which should have a list of subclasses available. The list of subclasses is available in their :attr:`subclasses` class attributes. Classes which have *explicitly* set :attr:`abstract` class attribute to ``True`` are not added to :attr:`subclasses`. If a class has ``modules_with_subclasses`` attribute (list or string), then specified modules for all installed applications can be loaded by calling :meth:`~RegisteredSubclassesBase.load_subclasses`. .. py:attribute:: modules_with_subclasses :annotation: = ['tests.test_dotted_field_classes'] .. py:attribute:: abstract :annotation: = True .. py:class:: TestDottedFieldSubclass Bases: :py:obj:`TestDottedFieldClass` A base class for classes which should have a list of subclasses available. The list of subclasses is available in their :attr:`subclasses` class attributes. Classes which have *explicitly* set :attr:`abstract` class attribute to ``True`` are not added to :attr:`subclasses`. If a class has ``modules_with_subclasses`` attribute (list or string), then specified modules for all installed applications can be loaded by calling :meth:`~RegisteredSubclassesBase.load_subclasses`. .. py:attribute:: description :annotation: = Description .. py:class:: TestFields(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:method:: test_dotted_name_field() .. py:method:: test_dotted_name_field_module_loading() .. py:class:: TestEnumField(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:method:: setUp() Hook method for setting up the test fixture before exercising it. .. py:method:: test_basic_usage() .. py:method:: test_serialization() Test if choices aren't serialized by migration. .. py:class:: TestExecute(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:method:: test_echo() .. py:method:: test_echo_with_list_command() .. py:method:: test_cat_with_string_input() .. py:method:: test_error() .. py:method:: test_ignored_error() .. py:method:: test_ignored_error_list() .. py:method:: test_line_splitting() .. py:method:: test_env() .. py:method:: test_cwd() .. py:class:: TestMisc(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:method:: test_reload_settings_for_coverage() .. py:method:: test_uploaded_file_name() .. py:method:: test_make_html_links() .. py:class:: TestRegistration(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:method:: test_registration_form_fields() .. py:method:: _register_user(terms_accepted=True, pass_captcha=True) .. py:method:: _assert_user_active() .. py:method:: test_registration_with_activation_email() .. py:method:: test_registration_without_activation_email() .. py:method:: test_registration_terms_not_accepted() .. py:method:: test_registration_captcha_not_passed() .. py:class:: TestArchive(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:: good_files :annotation: = ['archive.tgz', 'archive.zip'] .. py:attribute:: bad_files :annotation: = ['archive-with-symlink.tgz', 'archive-with-hardlink.tgz'] .. py:attribute:: base_dir .. py:method:: test_archive() .. py:method:: test_size_calc() .. py:class:: TestAdmin(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'] .. py:method:: test_admin_delete() .. py:method:: test_import_users() .. py:class:: TestBaseViews(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'] .. py:method:: setUp() Hook method for setting up the test fixture before exercising it. .. py:method:: test_edit_profile_view() .. py:method:: test_edit_email() .. py:method:: test_terms_not_accepted() .. py:method:: test_username_change_attempt() .. py:method:: test_unicode_wrong_first_name() .. py:method:: test_unicode_wrong_last_name() .. py:method:: test_names_with_valid_spaces() .. py:method:: test_names_with_invalid_spaces() .. py:method:: test_profile_dynamic_fields() .. py:class:: TestBackendMiddleware(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'] .. py:method:: test_backend_middleware() .. py:class:: TestNotifications(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'] .. py:method:: test_notification_registration() .. py:class:: TestCondition(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'] .. py:method:: _fake_request_factory() .. py:method:: setUp() Hook method for setting up the test fixture before exercising it. .. py:method:: test_and_operator() .. py:method:: test_or_operator() .. py:method:: test_inverse_operator() .. py:method:: test_make_condition() .. py:method:: test_request_condition() .. py:method:: test_enforce_condition_success() .. py:method:: test_enforce_condition_failure_with_template() .. py:method:: test_enforce_condition_failure_without_template() .. py:method:: test_enforce_failing_condition_without_require_login() .. py:method:: test_enforce_passing_condition_without_require_login() .. py:class:: TestLoginChange(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'] .. py:method:: setUp() Hook method for setting up the test fixture before exercising it. .. py:method:: test_message() .. py:method:: test_can_change_login_from_invalid() .. py:method:: test_login_cannot_change_from_valid() .. py:method:: test_failed_login_change() .. py:class:: TestPreferences(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'] .. py:method:: test_language_preferences() .. py:method:: test_registration_preferences() .. py:class:: TestTranslate(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:method:: test_translate() .. py:class:: TestFileUtils(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:method:: test_split_ext() .. py:method:: test_strip_num_or_hash() .. py:class:: TestUserDeactivationLogout(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'] .. py:method:: setUp() Hook method for setting up the test fixture before exercising it. .. py:method:: assert_logged(logged=True) .. py:method:: test_invalidated_user_logout() .. py:class:: TestObtainingAPIToken(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'] .. py:method:: setUp() Hook method for setting up the test fixture before exercising it. .. py:method:: test_api_token_view() .. py:method:: test_api_token_regeneration() .. py:class:: TestDocsEndpoints(methodName='runTest') Bases: :py:obj:`rest_framework.test.APITestCase` 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:method:: test_docs() .. py:class:: TestPingEndpointsAndAuthentication(methodName='runTest') Bases: :py:obj:`rest_framework.test.APITestCase` 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'] .. py:method:: test_ping() .. py:method:: test_auth_ping() .. py:method:: test_auth_ping_with_token() .. py:method:: test_auth_ping_with_session() .. py:class:: TestPasswordReset(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'] .. py:method:: setUp() Hook method for setting up the test fixture before exercising it. .. py:method:: test_reset_password_email_send_existing() .. py:class:: TestAccountDeletion(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'] .. py:method:: setUp() Hook method for setting up the test fixture before exercising it. .. py:method:: test_account_deletion_correct_password() .. py:method:: test_account_deletion_incorrect_password() .. py:method:: test_account_deletion_no_password() .. py:class:: TestJsCatalog(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:method:: test_javascript_catalog()