class documentation

class TransactionTestCase(SimpleTestCase):

Known subclasses: django.test.LiveServerTestCase, django.test.testcases.TestCase

View In Hierarchy

Undocumented

Class Method ​_databases​_names Undocumented
Method ​_fixture​_setup Undocumented
Method ​_fixture​_teardown Undocumented
Method ​_post​_teardown No summary
Method ​_pre​_setup No summary
Method ​_reset​_sequences Undocumented
Method ​_should​_reload​_connections Undocumented
Method assert​Num​Queries Undocumented
Method assert​Queryset​Equal Undocumented
Class Variable ​_disallowed​_database​_msg Undocumented
Class Variable available​_apps Undocumented
Class Variable databases Undocumented
Class Variable fixtures Undocumented
Class Variable reset​_sequences Undocumented
Class Variable serialized​_rollback Undocumented

Inherited from SimpleTestCase:

Class Method set​Up​Class Undocumented
Class Method ​_add​_databases​_failures Undocumented
Class Method ​_remove​_databases​_failures Undocumented
Class Method ​_validate​_databases Undocumented
Method __call__ Wrapper around default __call__ method to perform common Django test set up. This means that user-defined Test Cases aren't required to include a call to super().setUp().
Method ​_assert​_contains Undocumented
Method ​_assert​_raises​_or​_warns​_cm Undocumented
Method ​_assert​_template​_used Undocumented
Method _assert​Foo​Message Undocumented
Method ​_setup​_and​_call Perform the following in order: pre-setup, run test, post-teardown, skipping pre/post hooks if test is set to be skipped.
Method assert​Contains No summary
Method assert​Field​Output Assert that a form field behaves correctly with various inputs.
Method assert​Form​Error Assert that a form used to render the response has a specific field error.
Method assert​Formset​Error Assert that a formset used to render the response has a specific error.
Method assert​HTMLEqual Assert that two HTML snippets are semantically the same. Whitespace in most cases is ignored, and attribute ordering is not significant. The arguments must be valid HTML.
Method assert​HTMLNot​Equal Assert that two HTML snippets are not semantically equivalent.
Method assert​In​HTML Undocumented
Method assert​JSONEqual Assert that the JSON fragments raw and expected_data are equal. Usual JSON non-significant whitespace rules apply as the heavyweight is delegated to the json library.
Method assert​JSONNot​Equal Assert that the JSON fragments raw and expected_data are not equal. Usual JSON non-significant whitespace rules apply as the heavyweight is delegated to the json library.
Method assert​No​Logs Assert no messages are logged on the logger, with at least the given level.
Method assert​Not​Contains Assert that a response indicates that some content was retrieved successfully, (i.e., the HTTP status code was as expected) and that text doesn't occur in the content of the response.
Method assert​Raises​Message Assert that expected_message is found in the message of a raised exception.
Method assert​Redirects Assert that a response redirected to a specific URL and that the redirect URL can be loaded.
Method assert​Template​Not​Used Assert that the template with the provided name was NOT used in rendering the response. Also usable as context manager.
Method assert​Template​Used Assert that the template with the provided name was used in rendering the response. Also usable as context manager.
Method assert​URLEqual Assert that two URLs are the same, ignoring the order of query string parameters except for parameters with the same name.
Method assert​Warns​Message Same as assertRaisesMessage but for assertWarns() instead of assertRaises().
Method assert​XMLEqual Assert that two XML snippets are semantically the same. Whitespace in most cases is ignored and attribute ordering is not significant. The arguments must be valid XML.
Method assert​XMLNot​Equal Assert that two XML snippets are not semantically equivalent. Whitespace in most cases is ignored and attribute ordering is not significant. The arguments must be valid XML.
Method debug Perform the same as __call__(), without catching the exception.
Method modify​_settings A context manager that temporarily applies changes a list setting and reverts back to the original value when exiting the context.
Method settings A context manager that temporarily sets a setting and reverts to the original value when exiting the context.
Class Variable ​_disallowed​_connection​_methods Undocumented
Class Variable ​_modified​_settings Undocumented
Class Variable ​_overridden​_settings Undocumented
Instance Variable async​_client Undocumented
Instance Variable client Undocumented
@classmethod
def _databases_names(cls, include_mirrors=True):

Undocumented

def _fixture_setup(self):

Undocumented

def _fixture_teardown(self):

Undocumented

def _post_teardown(self):

Perform post-test things: * Flush the contents of the database to leave a clean slate. If the

class has an 'available_apps' attribute, don't fire post_migrate.
  • Force-close the connection so the next test gets a clean cursor.
def _pre_setup(self):

Perform pre-test setup: * If the class has an 'available_apps' attribute, restrict the app

registry to these applications, then fire the post_migrate signal -- it must run with the correct set of applications for the test case.
  • If the class has a 'fixtures' attribute, install those fixtures.
def _reset_sequences(self, db_name):

Undocumented

def _should_reload_connections(self):

Undocumented

def assertNumQueries(self, num, func=None, *args, using=DEFAULT_DB_ALIAS, **kwargs):

Undocumented

def assertQuerysetEqual(self, qs, values, transform=None, ordered=True, msg=None):

Undocumented

_disallowed_database_msg: str =
databases =
fixtures =

Undocumented

reset_sequences: bool =

Undocumented

serialized_rollback: bool =

Undocumented