diff options
author | Simon Charette <charette.s@gmail.com> | 2013-11-17 17:26:20 -0500 |
---|---|---|
committer | Tim Graham <timograham@gmail.com> | 2015-01-10 12:24:52 -0500 |
commit | 07988744b347302925bc6cc66511e34224db55ab (patch) | |
tree | 8931006956c957f377133fda6852dafc60e03ff9 /tests/modeladmin | |
parent | 48ad288679a0cb2e2cfb17f128903e6c5b1c4870 (diff) | |
download | django-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.py | 26 |
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): """ |