Skip to content

Commit 67abb37

Browse files
Correct some missing parameters in docs
1 parent 6513797 commit 67abb37

File tree

1 file changed

+34
-25
lines changed

1 file changed

+34
-25
lines changed

docs/source/test_cases/integration_test_case/other_functionality.rst

Lines changed: 34 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ assertRedirects()
2626

2727
.. code::
2828
29-
self.assertRedirects()
29+
self.assertRedirects(response, expected_redirect_url)
3030
3131
Asserts that a request is redirected to a specific URL.
3232

@@ -50,7 +50,7 @@ assertStatusCode()
5050

5151
.. code::
5252
53-
self.assertStatusCode()
53+
self.assertStatusCode(response, expected_status)
5454
5555
Asserts that a response has a given status code value.
5656

@@ -67,17 +67,20 @@ assertPageTitle()
6767

6868
.. code::
6969
70-
self.assertPageTitle()
70+
self.assertPageTitle(response, expected_title, allow_partials=True)
7171
7272
Asserts that a response has a given title value. Aka, the ``<title>`` tag
7373
contents.
7474

7575
:param response: Response object to check against.
7676
:param expected_title: Expected title text that response should have.
77-
:param exact_match: Bool indicating if title needs to match exactly, or is
78-
allowed partial matches. Useful when site title is long,
79-
and tests only care about a specific subsection of the
80-
title.
77+
:param allow_partials: Bool indicating if title needs to match exactly, or is
78+
allowed partial matches.
79+
Useful when site title is long, and tests only care about
80+
a specific subsection of the title.
81+
Defaults to False, aka must be an exact match.
82+
For a site-wide version of this param, see
83+
:ref:`configuration/general:ALLOW_TITLE_PARTIALS`
8184

8285
:return: The found title value, in case tests need to run additional logic
8386
on it.
@@ -88,7 +91,7 @@ assertPageHeader()
8891

8992
.. code::
9093
91-
self.assertPageHeader()
94+
self.assertPageHeader(response, expected_header)
9295
9396
Asserts that a response has a given page header value. Aka, the ``<h1>`` tag
9497
contents.
@@ -98,7 +101,7 @@ However, not all sites follow this rule, and this assertion does not work
98101
reliably in cases when there are multiple ``<h1>`` header tags on a page.
99102

100103
:param response: Response object to check against.
101-
:param expected_title: Expected page header text that response should have.
104+
:param expected_header: Expected page header text that response should have.
102105

103106
:return: The found page header value, in case tests need to run additional
104107
logic on it.
@@ -109,7 +112,7 @@ assertContextMessages()
109112

110113
.. code::
111114
112-
self.assertContextMessages()
115+
self.assertContextMessages(response, expected_messages, allow_partials=True)
113116
114117
Asserts that a response has the given context message values. These are
115118
usually generated with the
@@ -120,10 +123,13 @@ expected strings.
120123

121124
:param response: Response object to check against.
122125
:param expected_messages: Expected messages that response should contain.
123-
:param allow_partials: Bool indicating if messages must match exactly, or
124-
are allowed partial matches. Useful for messages that
125-
are extra long, and tests only care about a specific
126-
subsection of the message.
126+
:param allow_partials: Bool indicating if message needs to match exactly, or is
127+
allowed partial matches.
128+
Useful when messages are long, and tests only care about
129+
a specific subsection of the messages.
130+
Defaults to False, aka must be an exact match.
131+
For a project-wide version of this param, see
132+
:ref:`configuration/general:ALLOW_MESSAGE_PARTIALS`
127133

128134
:return: None.
129135

@@ -154,7 +160,7 @@ assertNotContextMessages()
154160

155161
.. code::
156162
157-
self.assertNotContextMessages()
163+
self.assertNotContextMessages(response, expected_not_messages, allow_partials=True)
158164
159165
The negation of
160166
:ref:`test_cases/integration_test_case/other_functionality:assertContextMessages()`
@@ -168,10 +174,13 @@ expected strings.
168174
:param response: Response object to check against.
169175
:param expected_not_messages: Expected messages that response should NOT
170176
contain.
171-
:param allow_partials: Bool indicating if messages must match exactly, or
172-
are allowed partial matches. Useful for messages that
173-
are extra long, and tests only care about a specific
174-
subsection of the message.
177+
:param allow_partials: Bool indicating if message needs to match exactly, or is
178+
allowed partial matches.
179+
Useful when messages are long, and tests only care about
180+
a specific subsection of the messages.
181+
Defaults to False, aka must be an exact match.
182+
For a project-wide version of this param, see
183+
:ref:`configuration/general:ALLOW_MESSAGE_PARTIALS`
175184

176185
:return: None.
177186

@@ -181,7 +190,7 @@ assertPageContent()
181190

182191
.. code::
183192
184-
self.assertPageContent()
193+
self.assertPageContent(response, expected_content, ignore_ordering=True)
185194
186195
Asserts that a response has the given page content html.
187196

@@ -190,8 +199,8 @@ expected strings.
190199

191200
:param response: Response object to check against.
192201
:param expected_content: Expected content that response should contain.
193-
:param ignore_ordering: Bool indicating if content ordering matters. Defaults
194-
to assuming ordering should be obeyed.
202+
:param ignore_ordering: Bool indicating if content ordering matters.
203+
Defaults to assuming ordering should be obeyed.
195204
:param content_starts_after: Optional content value to strip out of search
196205
space. This value and anything above will be
197206
removed. If multiple instances exist on page, then
@@ -212,7 +221,7 @@ assertNotPageContent()
212221

213222
.. code::
214223
215-
self.assertNotPageContent()
224+
self.assertNotPageContent(response, expected_not_content, ignore_ordering=True)
216225
217226
The negation of
218227
:ref:`test_cases/integration_test_case/other_functionality:assertPageContent()`
@@ -237,7 +246,7 @@ assertRepeatingElement()
237246

238247
.. code::
239248
240-
self.assertRepeatingElement()
249+
self.assertRepeatingElement(response, expected_repeating_element, repeat_count)
241250
242251
:param response: Response object to check against.
243252
:param expected_repeating_element: The expected repeating HTML element.
@@ -366,7 +375,7 @@ _assertResponse__post_builtin_tests()
366375

367376
.. code::
368377
369-
self._assertResponse__post_builtin_tests()
378+
self._assertResponse__post_builtin_tests(*args, **kwargs)
370379
371380
372381
This function is called after getting the

0 commit comments

Comments
 (0)