:orphan: :py:mod:`oioioi.problems.tests.tests` ===================================== .. py:module:: oioioi.problems.tests.tests Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: oioioi.problems.tests.tests.TestModels oioioi.problems.tests.tests.TestProblemsharing oioioi.problems.tests.tests.TestNavigationBarItems oioioi.problems.tests.tests.TestVisibilityMigration oioioi.problems.tests.tests.TestVisibilityMigrationReverse .. py:class:: TestModels(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_problem_controller_property() .. py:method:: test_make_problem_filename() .. py:class:: TestProblemsharing(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', 'teachers', 'test_contest'] .. py:method:: test_shared_with_me_view() .. py:method:: test_visibility_field_present() .. py:method:: test_visibility_default_preference() .. py:class:: TestNavigationBarItems(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_navigation_bar_items_anonymous() .. py:method:: test_navigation_bar_items_translation() .. py:method:: test_navigation_bar_items_admin() .. py:class:: TestVisibilityMigration(methodName='runTest') Bases: :py:obj:`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/ .. py:attribute:: migrate_from :annotation: = 0013_newtags .. py:attribute:: migrate_to :annotation: = 0016_visibility_part3 .. py:method:: setUpBeforeMigration(apps) .. py:method:: test() .. py:class:: TestVisibilityMigrationReverse(methodName='runTest') Bases: :py:obj:`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/ .. py:attribute:: migrate_from :annotation: = 0016_visibility_part3 .. py:attribute:: migrate_to :annotation: = 0013_newtags .. py:method:: setUpBeforeMigration(apps) .. py:method:: test()