diff options
| author | Alexander Gaevsky <sasha@sasha0.ru> | 2016-01-07 11:07:15 +0200 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2016-01-08 12:28:32 -0500 |
| commit | ade54ffa34ddc6c19b26c6ea72b46f73af7b682b (patch) | |
| tree | beba0456c0075bf7ad4e0d9f2a30a813b6014272 /tests/admin_views/tests.py | |
| parent | 822a03b3e41c7c26b7b623c782fbcf9e6eea863f (diff) | |
Refs #25165 -- Fixed JSON serialization for add/edit popup in the admin.
Forwardport of test in o839d71d8562abe0b245024e55ca1d02a45e58fd from stable/1.9.x
(refs #25997).
Diffstat (limited to 'tests/admin_views/tests.py')
| -rw-r--r-- | tests/admin_views/tests.py | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/tests/admin_views/tests.py b/tests/admin_views/tests.py index 49afb860c5..7f94358fec 100644 --- a/tests/admin_views/tests.py +++ b/tests/admin_views/tests.py @@ -52,14 +52,14 @@ from .models import ( 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, + 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, ) @@ -4515,6 +4515,22 @@ class SeleniumAdminViewsFirefoxTests(AdminSeleniumWebDriverTestCase): select = Select(self.selenium.find_element_by_id('id_form-0-section')) self.assertEqual(select.first_selected_option.text, 'new section') + 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' |
