summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBrian Rosner <brosner@gmail.com>2008-05-05 17:31:23 +0000
committerBrian Rosner <brosner@gmail.com>2008-05-05 17:31:23 +0000
commitbe31882eee70529b8a85ecefbeb20f7ecc0f1fd1 (patch)
tree58942ecb155b503b95814b3f892c23992e04d4c3 /tests
parent6b6778ac46fcedf5643a62b4e962df16b862ba91 (diff)
newforms-admin: Applied the same _has_changed treatment to the ManyToManyRawIdWidget from [7515] since it acts similar with the underlying data.
git-svn-id: http://code.djangoproject.com/svn/django/branches/newforms-admin@7516 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests')
-rw-r--r--tests/regressiontests/admin_widgets/models.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/regressiontests/admin_widgets/models.py b/tests/regressiontests/admin_widgets/models.py
index 7207e8edd4..97e8f23bf9 100644
--- a/tests/regressiontests/admin_widgets/models.py
+++ b/tests/regressiontests/admin_widgets/models.py
@@ -66,6 +66,18 @@ Currently: <a target="_blank" href="%(MEDIA_URL)stest">test</a> <br />Change: <i
>>> w = ManyToManyRawIdWidget(rel)
>>> print conditional_escape(w.render('test', [m1.pk, m2.pk], attrs={}))
<input type="text" name="test" value="1,2" class="vManyToManyRawIdAdminField" /><a href="../../../admin_widgets/member/" 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>
+>>> w._has_changed(None, None)
+False
+>>> w._has_changed([], None)
+False
+>>> w._has_changed(None, [u'1'])
+True
+>>> w._has_changed([1, 2], [u'1', u'2'])
+False
+>>> w._has_changed([1, 2], [u'1'])
+True
+>>> w._has_changed([1, 2], [u'1', u'3'])
+True
""" % {
'ADMIN_MEDIA_PREFIX': settings.ADMIN_MEDIA_PREFIX,