1
0
mirror of https://github.com/django/django.git synced 2025-10-24 14:16:09 +00:00

Fixed #30973 -- Converted selenium tests wait_page_loaded to context manager.

This commit is contained in:
Johannes Hoppe
2019-11-27 20:36:26 +07:00
committed by Carlton Gibson
parent 8d32290279
commit 69dbb6b708
4 changed files with 44 additions and 36 deletions

View File

@@ -4584,8 +4584,8 @@ class SeleniumTests(AdminSeleniumTestCase):
num_initial_select2_inputs + 6
)
# Save and check that everything is properly stored in the database
self.selenium.find_element_by_xpath('//input[@value="Save"]').click()
self.wait_page_loaded()
with self.wait_page_loaded():
self.selenium.find_element_by_xpath('//input[@value="Save"]').click()
self.assertEqual(MainPrepopulated.objects.all().count(), 1)
MainPrepopulated.objects.get(
name=' this is the mAin nÀMë and it\'s awεšomeııı',
@@ -4652,8 +4652,8 @@ class SeleniumTests(AdminSeleniumTestCase):
self.assertEqual(slug2, 'option-two-main-name-best')
# Save the object
self.selenium.find_element_by_xpath('//input[@value="Save"]').click()
self.wait_page_loaded()
with self.wait_page_loaded():
self.selenium.find_element_by_xpath('//input[@value="Save"]').click()
self.selenium.get(object_url)
self.selenium.find_element_by_id('id_name').send_keys(' hello')