mirror of
https://github.com/django/django.git
synced 2025-08-18 17:50:58 +00:00
[1.9.x] Fixed #25997 -- Removed redundant escaping in admin's edit related model popup.
This commit is contained in:
parent
f42ab40b73
commit
a839d71d85
5 changed files with 58 additions and 22 deletions
|
@ -51,14 +51,15 @@ from .models import (
|
|||
ExternalSubscriber, Fabric, FancyDoodad, FieldOverridePost,
|
||||
FilteredManager, FooAccount, FoodDelivery, FunkyTag, Gallery, Grommet,
|
||||
Inquisition, Language, Link, MainPrepopulated, ModelWithStringPrimaryKey,
|
||||
OtherStory, Paper, Parent, ParentWithDependentChildren, Person, Persona,
|
||||
Picture, Pizza, Plot, PlotDetails, PluggableSearchPerson, Podcast, Post,
|
||||
PrePopulatedPost, Promo, Question, Recommendation, Recommender,
|
||||
RelatedPrepopulated, Report, Restaurant, RowLevelChangePermissionModel,
|
||||
SecretHideout, Section, ShortMessage, Simple, State, Story, Subscriber,
|
||||
SuperSecretHideout, SuperVillain, Telegram, TitleTranslation, Topping,
|
||||
UnchangeableObject, UndeletableObject, UnorderedObject, Villain, Vodcast,
|
||||
Whatsit, Widget, Worker, WorkHour,
|
||||
OtherStory, Paper, Parent, ParentWithDependentChildren, ParentWithUUIDPK,
|
||||
Person, Persona, Picture, Pizza, Plot, PlotDetails, PluggableSearchPerson,
|
||||
Podcast, Post, PrePopulatedPost, Promo, Question, Recommendation,
|
||||
Recommender, RelatedPrepopulated, RelatedWithUUIDPKModel, Report,
|
||||
Restaurant, RowLevelChangePermissionModel, SecretHideout, Section,
|
||||
ShortMessage, Simple, State, Story, Subscriber, SuperSecretHideout,
|
||||
SuperVillain, Telegram, TitleTranslation, Topping, UnchangeableObject,
|
||||
UndeletableObject, UnorderedObject, Villain, Vodcast, Whatsit, Widget,
|
||||
Worker, WorkHour,
|
||||
)
|
||||
|
||||
|
||||
|
@ -4569,6 +4570,22 @@ class SeleniumAdminViewsFirefoxTests(AdminSeleniumWebDriverTestCase):
|
|||
self.selenium.close()
|
||||
self.selenium.switch_to.window(self.selenium.window_handles[0])
|
||||
|
||||
def test_inline_uuid_pk_edit_with_popup(self):
|
||||
from selenium.webdriver.support.ui import Select
|
||||
parent = ParentWithUUIDPK.objects.create(title='test')
|
||||
related_with_parent = RelatedWithUUIDPKModel.objects.create(parent=parent)
|
||||
self.admin_login(username='super', password='secret', login_url=reverse('admin:index'))
|
||||
change_url = reverse('admin:admin_views_relatedwithuuidpkmodel_change', args=(related_with_parent.id,))
|
||||
self.selenium.get(self.live_server_url + change_url)
|
||||
self.selenium.find_element_by_id('change_id_parent').click()
|
||||
self.wait_for_popup()
|
||||
self.selenium.switch_to.window(self.selenium.window_handles[-1])
|
||||
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'))
|
||||
self.assertEqual(select.first_selected_option.text, str(parent.id))
|
||||
self.assertEqual(select.first_selected_option.get_attribute('value'), str(parent.id))
|
||||
|
||||
|
||||
class SeleniumAdminViewsChromeTests(SeleniumAdminViewsFirefoxTests):
|
||||
webdriver_class = 'selenium.webdriver.chrome.webdriver.WebDriver'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue