oioioi.base.tests.tests

Module Contents

Classes

TestPermsTemplateTags

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

TestIndex

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

TestIndexNoContest

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

TestMainPage

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

TestOrderedRegistry

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

TestMenu

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

TestErrorHandlers

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

TestUtils

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

TestAllWithPrefix

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

TestDottedFieldClass

A base class for classes which should have a list of subclasses

TestDottedFieldSubclass

A base class for classes which should have a list of subclasses

TestFields

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

TestEnumField

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

TestExecute

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

TestMisc

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

TestRegistration

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

TestArchive

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

TestAdmin

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

TestBaseViews

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

TestBackendMiddleware

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

TestNotifications

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

TestCondition

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

TestLoginChange

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

TestPreferences

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

TestTranslate

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

TestFileUtils

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

TestUserDeactivationLogout

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

TestObtainingAPIToken

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

TestDocsEndpoints

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

TestPingEndpointsAndAuthentication

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

TestPasswordReset

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

TestAccountDeletion

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

TestJsCatalog

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

Attributes

oioioi.base.tests.tests.basedir[source]
class oioioi.base.tests.tests.TestPermsTemplateTags(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'][source]
test_check_perms()[source]
class oioioi.base.tests.tests.TestIndex(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'][source]
test_login()[source]
test_admin_login_redirect()[source]
test_logout()[source]
test_index()[source]
test_accounts_menu()[source]
class oioioi.base.tests.tests.TestIndexNoContest(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'][source]
test_no_contest()[source]
test_navbar_login()[source]
class oioioi.base.tests.tests.TestMainPage(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'][source]
custom_templates[source]
test_custom_main_page()[source]
class oioioi.base.tests.tests.TestOrderedRegistry(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.

test_ordered_registry()[source]
class oioioi.base.tests.tests.TestMenu(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_icon'][source]
setUp()[source]

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

tearDown()[source]

Hook method for deconstructing the test fixture after testing it.

_render_menu(user=None)[source]
test_menu()[source]
test_is_contest_admin()[source]
test_menu_item_attrs_escape()[source]
test_side_menus_registry()[source]
class oioioi.base.tests.tests.TestErrorHandlers(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'][source]
setUp()[source]

Modify the client so that it follows to handler500 view on error, retaining cookies.

ajax_get(url)[source]
assertHtml(response, code)[source]
assertPlain(response, code)[source]
test_ajax_errors()[source]
test_errors()[source]
test_user_in_500()[source]
class oioioi.base.tests.tests.TestUtils(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.

test_classinit()[source]
test_registered_subclasses_meta()[source]
test_object_with_mixins()[source]
test_mixins_mro()[source]
test_registered_with_mixing()[source]
test_memoized()[source]
test_reset_memoized()[source]
test_utils_dont_need_settings()[source]
class oioioi.base.tests.tests.TestAllWithPrefix(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.

test_all_with_prefix()[source]
class oioioi.base.tests.tests.TestDottedFieldClass[source]

Bases: 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 subclasses class attributes. Classes which have explicitly set abstract class attribute to True are not added to subclasses.

If a class has modules_with_subclasses attribute (list or string), then specified modules for all installed applications can be loaded by calling load_subclasses().

modules_with_subclasses = ['tests.test_dotted_field_classes'][source]
abstract = True[source]
class oioioi.base.tests.tests.TestDottedFieldSubclass[source]

Bases: TestDottedFieldClass

A base class for classes which should have a list of subclasses available.

The list of subclasses is available in their subclasses class attributes. Classes which have explicitly set abstract class attribute to True are not added to subclasses.

If a class has modules_with_subclasses attribute (list or string), then specified modules for all installed applications can be loaded by calling load_subclasses().

description = Description[source]
class oioioi.base.tests.tests.TestFields(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.

test_dotted_name_field()[source]
test_dotted_name_field_module_loading()[source]
class oioioi.base.tests.tests.TestEnumField(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.

setUp()[source]

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

test_basic_usage()[source]
test_serialization()[source]

Test if choices aren’t serialized by migration.

class oioioi.base.tests.tests.TestExecute(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.

test_echo()[source]
test_echo_with_list_command()[source]
test_cat_with_string_input()[source]
test_error()[source]
test_ignored_error()[source]
test_ignored_error_list()[source]
test_line_splitting()[source]
test_env()[source]
test_cwd()[source]
class oioioi.base.tests.tests.TestMisc(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.

test_reload_settings_for_coverage()[source]
test_uploaded_file_name()[source]
class oioioi.base.tests.tests.TestRegistration(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.

test_registration_form_fields()[source]
_register_user(terms_accepted=True, pass_captcha=True)[source]
_assert_user_active()[source]
test_registration_with_activation_email()[source]
test_registration_without_activation_email()[source]
test_registration_terms_not_accepted()[source]
test_registration_captcha_not_passed()[source]
class oioioi.base.tests.tests.TestArchive(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.

good_files = ['archive.tgz', 'archive.zip'][source]
bad_files = ['archive-with-symlink.tgz', 'archive-with-hardlink.tgz'][source]
base_dir[source]
test_archive()[source]
test_size_calc()[source]
class oioioi.base.tests.tests.TestAdmin(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'][source]
test_admin_delete()[source]
test_import_users()[source]
class oioioi.base.tests.tests.TestBaseViews(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'][source]
setUp()[source]

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

test_edit_profile_view()[source]
test_edit_email()[source]
test_terms_not_accepted()[source]
test_username_change_attempt()[source]
test_unicode_wrong_first_name()[source]
test_unicode_wrong_last_name()[source]
test_names_with_valid_spaces()[source]
test_names_with_invalid_spaces()[source]
test_profile_dynamic_fields()[source]
class oioioi.base.tests.tests.TestBackendMiddleware(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'][source]
test_backend_middleware()[source]
class oioioi.base.tests.tests.TestNotifications(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'][source]
test_notification_registration()[source]
class oioioi.base.tests.tests.TestCondition(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'][source]
_fake_request_factory()[source]
setUp()[source]

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

test_and_operator()[source]
test_or_operator()[source]
test_inverse_operator()[source]
test_make_condition()[source]
test_request_condition()[source]
test_enforce_condition_success()[source]
test_enforce_condition_failure_with_template()[source]
test_enforce_condition_failure_without_template()[source]
test_enforce_failing_condition_without_require_login()[source]
test_enforce_passing_condition_without_require_login()[source]
class oioioi.base.tests.tests.TestLoginChange(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'][source]
setUp()[source]

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

test_message()[source]
test_can_change_login_from_invalid()[source]
test_login_cannot_change_from_valid()[source]
test_failed_login_change()[source]
class oioioi.base.tests.tests.TestPreferences(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'][source]
test_language_preferences()[source]
test_registration_preferences()[source]
class oioioi.base.tests.tests.TestTranslate(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.

test_translate()[source]
class oioioi.base.tests.tests.TestFileUtils(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.

test_split_ext()[source]
test_strip_num_or_hash()[source]
class oioioi.base.tests.tests.TestUserDeactivationLogout(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'][source]
setUp()[source]

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

assert_logged(logged=True)[source]
test_invalidated_user_logout()[source]
class oioioi.base.tests.tests.TestObtainingAPIToken(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'][source]
setUp()[source]

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

test_api_token_view()[source]
test_api_token_regeneration()[source]
class oioioi.base.tests.tests.TestDocsEndpoints(methodName='runTest')[source]

Bases: 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.

test_docs()[source]
class oioioi.base.tests.tests.TestPingEndpointsAndAuthentication(methodName='runTest')[source]

Bases: 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.

fixtures = ['test_users'][source]
test_ping()[source]
test_auth_ping()[source]
test_auth_ping_with_token()[source]
test_auth_ping_with_session()[source]
class oioioi.base.tests.tests.TestPasswordReset(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'][source]
setUp()[source]

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

test_reset_password_email_send_existing()[source]
class oioioi.base.tests.tests.TestAccountDeletion(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'][source]
setUp()[source]

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

test_account_deletion_correct_password()[source]
test_account_deletion_incorrect_password()[source]
test_account_deletion_no_password()[source]
class oioioi.base.tests.tests.TestJsCatalog(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.

test_javascript_catalog()[source]