oioioi.problems.tests.tests

Module Contents

Classes

TestModels

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

TestProblemsharing

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

TestNavigationBarItems

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

TestVisibilityMigration

TestCase for Django Migrations

TestVisibilityMigrationReverse

TestCase for Django Migrations

class oioioi.problems.tests.tests.TestModels(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_problem_controller_property()[source]
test_make_problem_filename()[source]
class oioioi.problems.tests.tests.TestProblemsharing(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', 'teachers', 'test_contest'][source]
test_shared_with_me_view()[source]
test_visibility_field_present()[source]
test_visibility_default_preference()[source]
class oioioi.problems.tests.tests.TestNavigationBarItems(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_navigation_bar_items_anonymous()[source]
test_navigation_bar_items_translation()[source]
test_navigation_bar_items_admin()[source]
class oioioi.problems.tests.tests.TestVisibilityMigration(methodName='runTest')[source]

Bases: oioioi.base.utils.test_migrations.TestCaseMigrations

TestCase for Django Migrations

migrate_from, migrate_to should be Django migration names of tested app setUpBeforeMigration(self, apps) method will be called before migrations are applied

source: https://www.caktusgroup.com/blog/2016/02/02/writing-unit-tests-django-migrations/

migrate_from = 0013_newtags[source]
migrate_to = 0016_visibility_part3[source]
setUpBeforeMigration(apps)[source]
test()[source]
class oioioi.problems.tests.tests.TestVisibilityMigrationReverse(methodName='runTest')[source]

Bases: oioioi.base.utils.test_migrations.TestCaseMigrations

TestCase for Django Migrations

migrate_from, migrate_to should be Django migration names of tested app setUpBeforeMigration(self, apps) method will be called before migrations are applied

source: https://www.caktusgroup.com/blog/2016/02/02/writing-unit-tests-django-migrations/

migrate_from = 0016_visibility_part3[source]
migrate_to = 0013_newtags[source]
setUpBeforeMigration(apps)[source]
test()[source]