Skip to content

Commit f4e2a8f

Browse files
A few minor misc corrections
1 parent 9fbd3c7 commit f4e2a8f

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

django_expanded_test_cases/constants/selenium_constants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
False,
4545
)
4646
)
47-
# Starting debug port, to get around remote-debugging-port option using the same value for all generated drivers,
47+
# Starting debug port, to get around remote-debugging-port option using the same value for all generated drivers.
4848
# Using the same port seems to cause issues with allowing proper switching between drivers.
4949
# Each generated driver increments this value by one, to guarantee all tests among all files should have unique ports.
5050
ETC_SELENIUM_DEBUG_PORT_START_VALUE = int(

django_expanded_test_cases/test_cases/base_test_case.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ def assertLogs(self, *args, **kwargs):
445445
`records` attribute will be a list of the corresponding LogRecord
446446
objects.
447447
448-
Example::
448+
Example:
449449
450450
with self.assertLogs('foo', level='INFO') as cm:
451451
logging.getLogger('foo').info('first message')

django_expanded_test_cases/test_cases/integration_test_case.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -695,6 +695,7 @@ def assertJsonResponse(
695695
self,
696696
url,
697697
*args,
698+
get=None,
698699
data=None,
699700
secure=True,
700701
return_format='json',
@@ -770,11 +771,24 @@ def assertJsonResponse(
770771
if not accept_header_defined:
771772
headers['Accept'] = 'application/json'
772773

774+
# Handle if GET or POST.
775+
if get is not None:
776+
# `get` explicitly provided. Use that.
777+
pass
778+
else:
779+
# `get` not explicitly provided. Determine from `data` arg.
780+
if data:
781+
# Has data. Assume POST response.
782+
get = False
783+
else:
784+
# No data. Assume GET response.
785+
get = True
786+
773787
# Call base function to handle actual logic.
774788
return self.assertResponse(
775789
url,
776790
*args,
777-
get=True,
791+
get=get,
778792
data=data,
779793
secure=secure,
780794
headers=headers,

0 commit comments

Comments
 (0)