mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
Removed hardcoded pks in admin selenium tests.
This commit is contained in:
@@ -69,6 +69,7 @@ from .models import (
|
||||
Collector,
|
||||
Color,
|
||||
ComplexSortedPerson,
|
||||
Country,
|
||||
CoverLetter,
|
||||
CustomArticle,
|
||||
CyclicOne,
|
||||
@@ -6698,11 +6699,12 @@ class SeleniumTests(AdminSeleniumTestCase):
|
||||
self.wait_until(lambda d: len(d.window_handles) == 1, 1)
|
||||
self.selenium.switch_to.window(self.selenium.window_handles[0])
|
||||
|
||||
argentina = Country.objects.get(name="Argentina")
|
||||
self.assertHTMLEqual(
|
||||
_get_HTML_inside_element_by_id(born_country_select_id),
|
||||
"""
|
||||
f"""
|
||||
<option value="" selected="">---------</option>
|
||||
<option value="1" selected="">Argentina</option>
|
||||
<option value="{argentina.pk}" selected="">Argentina</option>
|
||||
""",
|
||||
)
|
||||
# Argentina isn't added to the living_country select nor selected by
|
||||
@@ -6736,12 +6738,13 @@ class SeleniumTests(AdminSeleniumTestCase):
|
||||
self.wait_until(lambda d: len(d.window_handles) == 1, 1)
|
||||
self.selenium.switch_to.window(self.selenium.window_handles[0])
|
||||
|
||||
spain = Country.objects.get(name="Spain")
|
||||
self.assertHTMLEqual(
|
||||
_get_HTML_inside_element_by_id(born_country_select_id),
|
||||
"""
|
||||
f"""
|
||||
<option value="" selected="">---------</option>
|
||||
<option value="1" selected="">Argentina</option>
|
||||
<option value="2">Spain</option>
|
||||
<option value="{argentina.pk}" selected="">Argentina</option>
|
||||
<option value="{spain.pk}">Spain</option>
|
||||
""",
|
||||
)
|
||||
|
||||
@@ -6778,12 +6781,13 @@ class SeleniumTests(AdminSeleniumTestCase):
|
||||
self.wait_until(lambda d: len(d.window_handles) == 1, 1)
|
||||
self.selenium.switch_to.window(self.selenium.window_handles[0])
|
||||
|
||||
italy = spain
|
||||
self.assertHTMLEqual(
|
||||
_get_HTML_inside_element_by_id(born_country_select_id),
|
||||
"""
|
||||
f"""
|
||||
<option value="" selected="">---------</option>
|
||||
<option value="1" selected="">Argentina</option>
|
||||
<option value="2">Italy</option>
|
||||
<option value="{argentina.pk}" selected="">Argentina</option>
|
||||
<option value="{italy.pk}">Italy</option>
|
||||
""",
|
||||
)
|
||||
# Italy is added to the living_country select and it's also selected by
|
||||
|
||||
Reference in New Issue
Block a user