| Age | Commit message (Collapse) | Author |
|
Rewrapped long docstrings and block comments to 79 characters + newline
using script from https://github.com/medmunds/autofix-w505.
|
|
Manually reformatted some long docstrings and comments that would be
damaged by the to-be-applied autofixer script, in cases where editorial
judgment seemed necessary for style or wording changes.
|
|
|
|
|
|
ContentSecurityPolicyMiddleware.
Replaced the custom CSP middleware previously used in the admin's
AdminSeleniumTestCase with the official ContentSecurityPolicyMiddleware.
This change ensures alignment with Django's built-in CSP support.
Also updates the test logic to inspect browser console logs to assert
that no CSP violations are triggered during Selenium admin tests.
|
|
|
|
|
|
Co-authored-by: Natalia <124304+nessita@users.noreply.github.com>
|
|
Black 23.1.0 is released which, as the first release of the year,
introduces the 2023 stable style. This incorporates most of last year's
preview style.
https://github.com/psf/black/releases/tag/23.1.0
|
|
|
|
Replaced deprecated `find_element[s]_by_*()` usages, in favour of
`find_element[s]()` with an explicit `By`.
|
|
|
|
|
|
|
|
Selenium .is_displayed().
All instances of AdminSeleniumTestCase.get_css_value() were used to
inspect the display property.
|
|
select_by_value.
|
|
|
|
|
|
Thanks Tim Graham for the review.
|
|
|
|
Thanks Tim Graham for polishing the patch, updating the tests, and
writing documentation. Thanks Carl Meyer for shepherding the DEP.
|
|
|
|
|
|
Browser names should be passed as a comma separated list to the --selenium flag.
Thanks Tim Graham, Simon Charette and Moritz Sichert for review and discussion.
|
|
|
|
|
|
|
|
This allows setting a Content-Security-Policy HTTP header
(refs #15727).
Special thanks to blighj, the original author of this patch.
|
|
|
|
Refs #20739. Thanks Raphaël Hertzog for the report and the initial
patch.
|
|
Thanks Piotr Kasprzyk for help with the patch.
|
|
import_string().
Thanks Aymeric Augustin for the suggestion and review.
|
|
This fixes (at least according to tests on the ci itself)
admin_widgets.tests.RelatedFieldWidgetSeleniumFirefoxTests.test_foreign_key_using_to_field
(http://ci.djangoproject.com/job/Django/database=mysql_gis,python=python2.7/3792/testReport/junit/admin_widgets.tests/RelatedFieldWidgetSeleniumFirefoxTests/test_foreign_key_using_to_field/)
The cause for this issue seems to be that wait_page_loaded was executed before click fired
and as such no profile got saved (again just an educated guess, but with this fix I can no
longer reproduce it -- fingers crossed).
|
|
This reverts commit 08c9ab5a0f564a3ac7803e6a97fae855f2e0524e.
|
|
|
|
Many thanks go to David Burns (@AutomatedTester) for helping me understand
css selectors and pointing me towards the correct selenium methods.
|
|
Added a refresh() before quit() in the selenium tests, since this
solves the problem of spurious test failures in some environments.
|
|
Ensure that selenium quits before the live server thread to
prevent occasional hangs when killing the live server.
|
|
tearDownClass is not called if setUpClass throws an exception, in our case
this means that LiveServerTestCase leaks LiveServerThread sockets if the
test happens to be skipped later on, and AdminSeleniumWebDriverTestCase
doesn't close it's already open browser window. To prevent this leakage
we catch errors where needed and manually call _tearDownClassInternal.
_tearDownClassInternal should be written as defensively as possible since
it is not allowed to make any assumptions on how far setUpClass got.
This patch should fix the sporadic "Address already in use"-errors on jenkins
and also the "This code isn't under transaction management"-error for sqlite
(also just on jenkins).
After discussion with koniiiik, jezdez, kmtracey, tos9, lifeless, nedbat and
voidspace it was decided that this is the safest approach (thanks to everyone
for their comments and help). Manually calling tearDownClass was shut down
cause we don't know how our users override our classes.
This is a private and very specialized API on purpose and should not be used
without a strong reason!
This patch partially reverts the earlier attempts to fix those issues,
namely:
2fa0dd73b18f55d0fdd1c1d54b1d18031bfcf1ed and
3c5775d36f7e431d9691829a78580873111cb714
Final note: If this patch breaks in a later version of Django, please be
very careful on how you fix it, you might not see test failures locally.
That said, this patch hopefully doesn't produce even more failures.
|
|
non-operational webdrivers.
|
|
If setUpClass throws an exception (in this case "Address already in use" if the
super call can't find any open port to bind too) tearDownClass is not called.
This results in open browser windows from the webdriver, hence we only construct
it once we are sure there is no code afterwards which could error out.
|
|
|
|
Refs #20680.
|
|
Fixed #20483.
|
|
|
|
|
|
The admin_widgets tests were issuing click() to the browser but
didn't wait for the effects of those clicks. This caused the resulting
request to be processed concurrently with the test case. When using
in-memory SQLite this caused weird failures.
Also added wait_page_loaded() to admin selenium tests for code
reuse.
Fixed #19856
|
|
Thanks Carl Meyer for the report.
|
|
report.
|
|
Thanks Clueless for the initial patch.
Note that unittest has been purposely left out (external package only used by Python 2.6).
|