diff options
| author | Anssi Kääriäinen <akaariai@gmail.com> | 2013-02-20 03:08:55 +0200 |
|---|---|---|
| committer | Anssi Kääriäinen <akaariai@gmail.com> | 2013-02-21 00:01:07 +0200 |
| commit | 96790fc02214b4d36df0ecb630159e65b28a5174 (patch) | |
| tree | 5b7fbffb678ad4c952ca4cc7cfea20c80fd7108b /tests/regressiontests/admin_widgets | |
| parent | 8ad436636fd385abd144274952b0c066885af042 (diff) | |
[1.5.x] Made a couple of selenium tests wait for page loaded
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, backpatch of 50677b29af39ca670274fb45087415c883c78b04
Diffstat (limited to 'tests/regressiontests/admin_widgets')
| -rw-r--r-- | tests/regressiontests/admin_widgets/tests.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/regressiontests/admin_widgets/tests.py b/tests/regressiontests/admin_widgets/tests.py index 76aa9f448f..fa599c618c 100644 --- a/tests/regressiontests/admin_widgets/tests.py +++ b/tests/regressiontests/admin_widgets/tests.py @@ -651,12 +651,14 @@ class HorizontalVerticalFilterSeleniumFirefoxTests(AdminSeleniumWebDriverTestCas self.selenium.get( '%s%s' % (self.live_server_url, '/admin_widgets/school/%s/' % self.school.id)) + self.wait_page_loaded() self.execute_basic_operations('vertical', 'students') self.execute_basic_operations('horizontal', 'alumni') # Save and check that everything is properly stored in the database --- self.selenium.find_element_by_xpath('//input[@value="Save"]').click() - self.school = models.School.objects.get(id=self.school.id) # Reload from database + self.wait_page_loaded() + self.school = models.School.objects.get(id=self.school.id) # Reload from database self.assertEqual(list(self.school.students.all()), [self.arthur, self.cliff, self.jason, self.john]) self.assertEqual(list(self.school.alumni.all()), @@ -735,6 +737,7 @@ class HorizontalVerticalFilterSeleniumFirefoxTests(AdminSeleniumWebDriverTestCas # 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() self.school = models.School.objects.get(id=self.school.id) # Reload from database self.assertEqual(list(self.school.students.all()), [self.jason, self.peter]) |
