diff --git a/tests/admin_views/tests.py b/tests/admin_views/tests.py index ec4dbc1fa12..0f46496c73e 100644 --- a/tests/admin_views/tests.py +++ b/tests/admin_views/tests.py @@ -4531,6 +4531,21 @@ class SeleniumAdminViewsFirefoxTests(AdminSeleniumWebDriverTestCase): self.assertEqual(select.first_selected_option.text, str(parent.id)) self.assertEqual(select.first_selected_option.get_attribute('value'), str(parent.id)) + def test_inline_uuid_pk_add_with_popup(self): + from selenium.webdriver.support.ui import Select + self.admin_login(username='super', password='secret', login_url=reverse('admin:index')) + self.selenium.get(self.live_server_url + reverse('admin:admin_views_relatedwithuuidpkmodel_add')) + self.selenium.find_element_by_id('add_id_parent').click() + self.wait_for_popup() + self.selenium.switch_to.window(self.selenium.window_handles[-1]) + self.selenium.find_element_by_id('id_title').send_keys('test') + self.selenium.find_element_by_xpath('//input[@value="Save"]').click() + self.selenium.switch_to.window(self.selenium.window_handles[0]) + select = Select(self.selenium.find_element_by_id('id_parent')) + uuid_id = str(ParentWithUUIDPK.objects.first().id) + self.assertEqual(select.first_selected_option.text, uuid_id) + self.assertEqual(select.first_selected_option.get_attribute('value'), uuid_id) + class SeleniumAdminViewsChromeTests(SeleniumAdminViewsFirefoxTests): webdriver_class = 'selenium.webdriver.chrome.webdriver.WebDriver'