Ticket #7028: tests-fix-for-improved-raw-id-admin-patch.patch

File tests-fix-for-improved-raw-id-admin-patch.patch, 1.2 KB (added by Marcob <marcoberi@…>, 7 years ago)

Little fix (one liner): now django tests run fine

  • regressiontests/admin_widgets/models.py

     
    5656>>> rel = Album._meta.get_field('band').rel
    5757>>> w = ForeignKeyRawIdWidget(rel)
    5858>>> print conditional_escape(w.render('test', band.pk, attrs={}))
    59 <input type="text" name="test" value="1" class="vForeignKeyRawIdAdminField" /><a href="../../../admin_widgets/band/" class="related-lookup" id="lookup_id_test" onclick="return showRelatedObjectLookupPopup(this);"> <img src="%(ADMIN_MEDIA_PREFIX)simg/admin/selector-search.gif" width="16" height="16" alt="Lookup"></a>&nbsp;<strong>Linkin Park</strong>
     59<input type="text" name="test" value="1" class="vForeignKeyRawIdAdminField" /><a href="../../../admin_widgets/band/" class="related-lookup" id="lookup_id_test" onclick="return showRelatedObjectLookupPopup(this);"> <img src="%(ADMIN_MEDIA_PREFIX)simg/admin/selector-search.gif" width="16" height="16" alt="Lookup"></a>&nbsp;<strong id="view_lookup_id_test">Linkin Park</strong>
    6060
    6161>>> m1 = Member.objects.create(pk=1, name='Chester')
    6262>>> m2 = Member.objects.create(pk=2, name='Mike')
Back to Top