From dd49269c7db008b2567f50cb03c4d3d9b321daa1 Mon Sep 17 00:00:00 2001 From: Arthur Koziel Date: Mon, 13 Sep 2010 00:04:27 +0000 Subject: [soc2010/app-loading] merged trunk git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2010/app-loading@13818 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- tests/regressiontests/admin_widgets/tests.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'tests/regressiontests/admin_widgets/tests.py') diff --git a/tests/regressiontests/admin_widgets/tests.py b/tests/regressiontests/admin_widgets/tests.py index fd0c25ca1a..c445644335 100644 --- a/tests/regressiontests/admin_widgets/tests.py +++ b/tests/regressiontests/admin_widgets/tests.py @@ -1,3 +1,5 @@ +# encoding: utf-8 + from django import forms from django.contrib import admin from django.contrib.admin import widgets @@ -151,3 +153,13 @@ class AdminForeignKeyRawIdWidget(DjangoTestCase): post_data) self.assertContains(response, 'Select a valid choice. That choice is not one of the available choices.') + + def test_invalid_target_id(self): + + for test_str in ('Iñtërnâtiônàlizætiøn', "1234'", -1234): + # This should result in an error message, not a server exception. + response = self.client.post('%s/admin_widgets/event/add/' % self.admin_root, + {"band": test_str}) + + self.assertContains(response, + 'Select a valid choice. That choice is not one of the available choices.') -- cgit v1.3