class documentation

class LiveServerTestCase(TransactionTestCase):

Known subclasses: django.contrib.staticfiles.testing.StaticLiveServerTestCase, django.test.selenium.SeleniumTestCase

View In Hierarchy

Do basically the same as TransactionTestCase but also launch a live HTTP server in a separate thread so that the tests may use another testing framework, such as Selenium for example, instead of the built-in dummy client. It inherits from TransactionTestCase instead of TestCase because the threads don't share the same transactions (unless if using in-memory sqlite) and each thread needs to commit all their transactions so that the other thread can see the changes.
Class Method set​Up​Class Undocumented
Class Method tear​Down​Class Undocumented
Class Method ​_create​_server​_thread Undocumented
Class Method ​_make​_connections​_override Undocumented
Class Method _tear​Down​Class​Internal Undocumented
Class Variable host Undocumented
Class Variable port Undocumented
Property allowed​_host Undocumented
Property live​_server​_url Undocumented

Inherited from TransactionTestCase:

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 (via TransactionTestCase):

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 setUpClass(cls):
@classmethod
def tearDownClass(cls):

Undocumented

@classmethod
def _create_server_thread(cls, connections_override):

Undocumented

@classmethod
def _make_connections_override(cls):

Undocumented

@classmethod
def _tearDownClassInternal(cls):

Undocumented

host: str =

Undocumented

port: int =

Undocumented

@classproperty
allowed_host =

Undocumented

@classproperty
live_server_url =

Undocumented