summaryrefslogtreecommitdiff
path: root/tests/modeladmin
diff options
context:
space:
mode:
authorSimon Charette <charette.s@gmail.com>2013-11-17 17:26:20 -0500
committerTim Graham <timograham@gmail.com>2015-01-10 12:24:52 -0500
commit07988744b347302925bc6cc66511e34224db55ab (patch)
tree8931006956c957f377133fda6852dafc60e03ff9 /tests/modeladmin
parent48ad288679a0cb2e2cfb17f128903e6c5b1c4870 (diff)
downloaddjango-07988744b347302925bc6cc66511e34224db55ab.tar.gz
Fixed #13165 -- Added edit and delete links to admin foreign key widgets.
Thanks to Collin Anderson for the review and suggestions and Tim for the final review.
Diffstat (limited to 'tests/modeladmin')
-rw-r--r--tests/modeladmin/tests.py26
1 files changed, 13 insertions, 13 deletions
diff --git a/tests/modeladmin/tests.py b/tests/modeladmin/tests.py
index ca3a8dbfaf..ee8c26c3ca 100644
--- a/tests/modeladmin/tests.py
+++ b/tests/modeladmin/tests.py
@@ -355,30 +355,30 @@ class ModelAdminTests(TestCase):
form = ma.get_form(request)()
self.assertHTMLEqual(str(form["main_band"]),
- '<select name="main_band" id="id_main_band">\n'
- '<option value="" selected="selected">---------</option>\n'
- '<option value="%d">The Beatles</option>\n'
- '<option value="%d">The Doors</option>\n'
- '</select>' % (band2.id, self.band.id))
+ '<div class="related-widget-wrapper">'
+ '<select name="main_band" id="id_main_band">'
+ '<option value="" selected="selected">---------</option>'
+ '<option value="%d">The Beatles</option>'
+ '<option value="%d">The Doors</option>'
+ '</select></div>' % (band2.id, self.band.id))
class AdminConcertForm(forms.ModelForm):
- pass
-
def __init__(self, *args, **kwargs):
super(AdminConcertForm, self).__init__(*args, **kwargs)
self.fields["main_band"].queryset = Band.objects.filter(name='The Doors')
- class ConcertAdmin(ModelAdmin):
+ class ConcertAdminWithForm(ModelAdmin):
form = AdminConcertForm
- ma = ConcertAdmin(Concert, self.site)
+ ma = ConcertAdminWithForm(Concert, self.site)
form = ma.get_form(request)()
self.assertHTMLEqual(str(form["main_band"]),
- '<select name="main_band" id="id_main_band">\n'
- '<option value="" selected="selected">---------</option>\n'
- '<option value="%d">The Doors</option>\n'
- '</select>' % self.band.id)
+ '<div class="related-widget-wrapper">'
+ '<select name="main_band" id="id_main_band">'
+ '<option value="" selected="selected">---------</option>'
+ '<option value="%d">The Doors</option>'
+ '</select></div>' % self.band.id)
def test_regression_for_ticket_15820(self):
"""