class documentation

class AdminSeleniumTestCase(SeleniumTestCase, StaticLiveServerTestCase):

View In Hierarchy

Undocumented

Method _assert​Options​Values Undocumented
Method admin​_login Log in to the admin.
Method assert​Selected​Options Assert that the <SELECT> widget identified by selector has the selected options with the given values.
Method assert​Select​Options Assert that the <SELECT> widget identified by selector has the options with the given values.
Method deselect​_option Deselect the <OPTION> with the value value inside the <SELECT> widget identified by the CSS selector selector.
Method has​_css​_class Return True if the element identified by selector has the CSS class klass.
Method select​_option Select the <OPTION> with the value value inside the <SELECT> widget identified by the CSS selector selector.
Method wait​_for Block until a CSS selector is found on the page.
Method wait​_for​_and​_switch​_to​_popup Block until num_windows are present and are ready (usually 2, but can be overridden in the case of pop-ups opening other pop-ups). Switch the current window to the new pop-up.
Method wait​_for​_text Block until the text is found in the CSS selector.
Method wait​_for​_value Block until the value is found in the CSS selector.
Method wait​_page​_loaded Block until a new page has loaded and is ready.
Method wait​_page​_ready Block until the page is ready.
Method wait​_until No summary
Method wait​_until​_invisible Block until the element described by the CSS selector is invisible.
Method wait​_until​_visible Block until the element described by the CSS selector is visible.
Class Variable available​_apps Undocumented

Inherited from SeleniumTestCase:

Class Method set​Up​Class Undocumented
Class Method _tear​Down​Class​Internal Undocumented
Method disable​_implicit​_wait Disable the default implicit wait.
Class Variable external​_host Undocumented
Class Variable implicit​_wait Undocumented
Property allowed​_host Undocumented
Property live​_server​_url Undocumented

Inherited from LiveServerTestCase (via SeleniumTestCase):

Class Method tear​Down​Class Undocumented
Class Method ​_create​_server​_thread Undocumented
Class Method ​_make​_connections​_override Undocumented
Class Variable host Undocumented
Class Variable port Undocumented

Inherited from TransactionTestCase (via SeleniumTestCase, LiveServerTestCase):

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 databases Undocumented
Class Variable fixtures Undocumented
Class Variable reset​_sequences Undocumented
Class Variable serialized​_rollback Undocumented

Inherited from SimpleTestCase (via SeleniumTestCase, LiveServerTestCase, 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

Inherited from LiveServerTestCase (via StaticLiveServerTestCase):

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 (via StaticLiveServerTestCase, LiveServerTestCase):

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 databases Undocumented
Class Variable fixtures Undocumented
Class Variable reset​_sequences Undocumented
Class Variable serialized​_rollback Undocumented

Inherited from SimpleTestCase (via StaticLiveServerTestCase, LiveServerTestCase, 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
def _assertOptionsValues(self, options_selector, values):

Undocumented

def admin_login(self, username, password, login_url='/admin/'):
Log in to the admin.
def assertSelectedOptions(self, selector, values):
Assert that the <SELECT> widget identified by selector has the selected options with the given values.
def assertSelectOptions(self, selector, values):
Assert that the <SELECT> widget identified by selector has the options with the given values.
def deselect_option(self, selector, value):
Deselect the <OPTION> with the value value inside the <SELECT> widget identified by the CSS selector selector.
def has_css_class(self, selector, klass):
Return True if the element identified by selector has the CSS class klass.
def select_option(self, selector, value):
Select the <OPTION> with the value value inside the <SELECT> widget identified by the CSS selector selector.
def wait_for(self, css_selector, timeout=10):
Block until a CSS selector is found on the page.
def wait_for_and_switch_to_popup(self, num_windows=2, timeout=10):
Block until num_windows are present and are ready (usually 2, but can be overridden in the case of pop-ups opening other pop-ups). Switch the current window to the new pop-up.
def wait_for_text(self, css_selector, text, timeout=10):
Block until the text is found in the CSS selector.
def wait_for_value(self, css_selector, text, timeout=10):
Block until the value is found in the CSS selector.
@contextmanager
def wait_page_loaded(self, timeout=10):
Block until a new page has loaded and is ready.
def wait_page_ready(self, timeout=10):
Block until the page is ready.
def wait_until(self, callback, timeout=10):
Block the execution of the tests until the specified callback returns a value that is not falsy. This method can be called, for example, after clicking a link or submitting a form. See the other public methods that call this function for more details.
def wait_until_invisible(self, css_selector, timeout=10):
Block until the element described by the CSS selector is invisible.
def wait_until_visible(self, css_selector, timeout=10):
Block until the element described by the CSS selector is visible.
available_apps: list[str] =