summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2026-04-03 09:13:11 -0400
committerJacob Walls <jacobtylerwalls@gmail.com>2026-04-03 09:30:10 -0400
commit123fa3a3f38abdb73055acc9a2cbbe3537f9323a (patch)
tree433abff5275bf1cf8338cd9cc5e5e01f9989de57 /tests
parentfcf916884d25ed430bd7cedaea2b10035c2aa3b6 (diff)
Refs #36949 -- Removed hardcoded pks in modeladmin tests.
Diffstat (limited to 'tests')
-rw-r--r--tests/modeladmin/tests.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/modeladmin/tests.py b/tests/modeladmin/tests.py
index 2516ca3207..74bbc83efb 100644
--- a/tests/modeladmin/tests.py
+++ b/tests/modeladmin/tests.py
@@ -849,7 +849,8 @@ class ModelAdminTests(TestCase):
'class="related-widget-wrapper" data-model-ref="band"><select '
'name="main_band" data-context="available-source" required '
'id="id_main_band" data-custom-widget="true" multiple>'
- '<option value="">---------</option><option value="1">The Doors</option>'
+ '<option value="">---------</option>'
+ f'<option value="{self.band.pk}">The Doors</option>'
"</select></div></div>"
)
self.assertInHTML(expected, cmafa().render())
@@ -873,9 +874,10 @@ class ModelAdminTests(TestCase):
expected = (
'<fieldset><legend>Main band:</legend><div class="related-widget-wrapper" '
'data-model-ref="band"><div id="id_main_band"><div><label '
- 'for="id_main_band_0"><input type="radio" name="main_band" value="1" '
- 'data-context="available-source" required id="id_main_band_0" '
- 'use_fieldset="true">The Doors</label></div></div></div></fieldset>'
+ 'for="id_main_band_0"><input type="radio" name="main_band" '
+ f'value="{self.band.pk}" data-context="available-source" '
+ 'required id="id_main_band_0" use_fieldset="true">The Doors</label>'
+ "</div></div></div></fieldset>"
)
self.assertInHTML(expected, cmafa().render())