oioioi.base.tests
¶
Submodules¶
Package Contents¶
Classes¶
Context manager that captures queries executed by the specified connection. |
|
Similar to TransactionTestCase, but use transaction.atomic() to achieve |
|
An authentication backend which accepts any password for an existing |
|
Functions¶
|
A context manager which causes all requests having the specified |
|
|
|
|
|
|
|
|
|
|
|
- class oioioi.base.tests._AssertNumQueriesLessThanContext(test_case, num, connection)[source]¶
Bases:
django.test.utils.CaptureQueriesContext
Context manager that captures queries executed by the specified connection.
- class oioioi.base.tests.TestCase(methodName='runTest')[source]¶
Bases:
django.test.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.
- class oioioi.base.tests.IgnorePasswordAuthBackend[source]¶
Bases:
object
An authentication backend which accepts any password for an existing user.
It’s configured in
test_settings.py
and available for all tests.
- oioioi.base.tests.fake_time(timestamp)[source]¶
A context manager which causes all requests having the specified timestamp, regardless of the real wall clock time.
- oioioi.base.tests.check_not_accessible(testcase, url_or_viewname, qs=None, *args, **kwargs)[source]¶